localize() switches to/from DST too late/early

Bug #1880599 reported by Jason Tuenge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pytz
New
Undecided
Unassigned

Bug Description

localize() switches to EDT an hour late in spring, and back to EST an hour early in fall. For example, it yields EST for naive 2020-03-08 at 1:30 (correctly) and 2:30 (incorrectly), versus EDT at 3:30 (correctly). Similarly, it yields EDT for naive 2019-11-03 at 0:30 (correctly), versus EST at 1:30 (incorrectly).

Revision history for this message
Jason Tuenge (jrtuenge) wrote :
Revision history for this message
Jason Tuenge (jrtuenge) wrote :

Sorry, I just realized that this is already discussed at https://pypi.org/project/pytz/ under "Problems with Localtime." So there is no 2:30 during the Spring Forward, and 1:30 occurs twice during the Fall Back. But I do think it'd be advisable to throw a warning message when such values are encountered -- to remind the user of the issue, while also helping to preclude errant bug reports (like mine here). I'd also suggest supplementing your webpage discussion of the Fall Back with my point here regarding the Spring Forward.

Revision history for this message
Jason Tuenge (jrtuenge) wrote :

And on a related note, the aforementioned webpage incorrectly states that DST ends on the "last Sunday morning in October." It actually ends on the first Sunday of November. For example, see https://www.nist.gov/pml/time-and-frequency-division/popular-links/daylight-saving-time-dst

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.