localize() switches to/from DST too late/early
Bug #1880599 reported by
Jason Tuenge
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).
To post a comment you must log in.
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.