oz / tz

🌐 A time zone helper
GNU General Public License v3.0
849 stars 33 forks source link

Daylight Saving Time (DST) transition days aren’t correctly supported #59

Closed jnd-au closed 2 weeks ago

jnd-au commented 3 weeks ago

Currently, tz does not support Daylight Saving transition days properly, with many defects including:

The fundamental problem is that tz assumes the hours of day run consecutively from 0..23 (24 hours per day) but this incorrect on days when daylight saving starts (only 23 hours in that day, due to a missing hour) and incorrect when daylight saving ends (25 hours on that day, due to a duplicated hour). Additionally, if DST changes at midnight in a timezone, then the showDates feature is incorrect too.

This is an edge case that only affects some timezones two day per year, however it blocks a major user story (use-case for tz), which is for users to use tz to see and understand the daylight saving in their or other timezones.

The stable release v0.7.0 shows a self-consistent display on DST transition days by using a single numerical timezone offset for the whole day, albeit this does not match any real-world clocks because they change their offset. Unfortunately the unreleased HEAD introduces new errors that further invalidate tz’s DST support.