Etc/GMT* zones seem to be inverted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pytz |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
The time offset in GMT* zones seems to be reversed.
In [1]: import datetime, pytz
In [2]: utc = pytz.utc
In [3]: tz1 = pytz.timezone(
In [4]: tz2 = pytz.timezone(
In [5]: datetime.
Out[5]: datetime.
In [6]: utc.localize(
Out[6]: datetime.
In [7]: utc.localize(
Out[7]: datetime.
In [8]: utc.localize(
Out[8]: datetime.
In [9]: tz3 = pytz.timezone(
In [10]: utc.localize(
Out[10]: datetime.
A very easy way to demonstrate (and to test):
In [19]: pytz.timezone( 'Etc/GMT- 3').utcoffset( None) timedelta( 0, 10800)
Out[19]: datetime.
In [20]: pytz.timezone( 'Etc/GMT+ 3').utcoffset( None) timedelta( -1, 75600)
Out[20]: datetime.
Both results are the opposite of what they should be. GMT+ zones should never point to a previous time.
I am familiarizing myself with the codebase, maybe I will be able to offer a patch.