pytz utctimetuple() produces wrong delta for Europe/London
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| pytz |
Undecided
|
Unassigned |
Bug Description
dt(2012, 10, 27, 12, 34, 56, 999999, tzinfo=
time.struct_
dt(2012, 10, 27, 12, 34, 56, 999999, tzinfo=
time.struct_
Note that the tm_min changes, but the hour doesn't... This seems to happen whatever date I provide with the Europe/London timezone.
James Blackburn (jamesblackburn) wrote : | #1 |
James Blackburn (jamesblackburn) wrote : | #2 |
And compared with tzfile:
lon_pytz = pytz.timezone(
lon_dtul = dateutil.
d
Out[167]: datetime.
d.replace(
Out[168]: time.struct_
d.replace(
Out[169]: time.struct_
d.replace(
Out[170]: False
gcc (chris+ubuntu-qwirx) wrote : | #3 |
Replacing the tzinfo is not a good idea. Calling utctimetuple() tries to translate from local time back to UTC, but clearly does so in an invalid way, not giving pytz a chance to choose the correct offset for this period in history. Note that the str(lon_pytz) is Local Mean Time, which is solar time (early timekeeping).
See http://
(Pdb) lon_pytz.
time.struct_
(Pdb) lon_pytz.
time.struct_
Using pytz: pytz-2015.2 / 2015.4