Australia/Sydney timezone conversions not reversible
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pytz |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The "Australia/Sydney" timezone behaves incorrectly when converting to UTC.
1) For a start its repr() looks suspicious:
<DstTzInfo 'Australia/Sydney' LMT+10:05:00 STD>
+10:05 ??
2) Conversions are not reversible. Note for this example I deliberately choose a date well away from timezone transitions:
>>> utc = pytz.utc
>>> autz = pytz.timezone(
>>> dtutc = datetime.
>>> dtutc.astimezon
datetime.
OK That looks correct - even the repr of the tzinfo looks correct. But let's try the same thing in reverse.
>>> dtautz = datetime.
>>> dtautz.
datetime.
Note that this is wrong by 5 minutes.
I tried upgrading pytz, but it is still occurring in 2015.4.