You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ZoneInfo evaluates zero-based TZ day-of-year rules one day early #159712
I would expect January 10 to still be STD, with DST starting at midnight on January 11. The unprefixed n form is a zero-based day of the year, so 0 means January 1 and 10 means January 11. Both implementations instead start DST on January 10. glibc's tzset() gives STD for January 10 with the same TZ string.
The pure-Python calculation uses a year baseline one day before January 1 and adds the day number directly. That works for the one-based Jn form, but leaves the zero-based n form one day early. The C calculation has the same extra day subtracted from the baseline.
This is related to but distinct from #152847, which fixed validation of non-digit day fields. The input here is valid; the resulting transition date is wrong.
Activity
pythongh-159712: Fix zero-based day rules in zoneinfo
pythongh-159712: Fix zero-based day rules in zoneinfo
pythongh-159712: Fix zero-based day rules in zoneinfo