2007-03-26 06:39:31 |
Stuart Bishop |
pytz: statusexplanation |
|
>>> dt = datetime(2007, 3, 11, 0, 0, 0)
>>> aj = pytz.timezone("Africa/Johannesburg")
>>> dt = aj.localize(dt, is_dst=True)
>>> dt.tzinfo.utcoffset(dt)
datetime.timedelta(0, 7200)
Until the tzinfo has been put into context, its behavior is undefined. Check out the README for details on constructing localized tzinfo instances. The api is somewhat different to what is documented in the Python reference.
The offsets for the legacy Etc/GMT* timezones is that way round because this is how it is in the source database. It is the wrong way around, but this is the way it has always been under Unix and changing this would break compatibility with other systems (which is also why it isn't fixed upstream). The Etc/* timezones are all deprecated and only there to support legacy systems and data if I recall correctly.
|
|