Correct value:
>>> pytz.timezone('Asia/Tehran').utcoffset(datetime(2013, 1, 1)).total_seconds()/3600.0
3.5
>>> pytz.timezone('Asia/Tehran').utcoffset(datetime(2013, 1, 1)).total_seconds()
12600.0
Incorrect value:
>>> pytz.timezone('Asia/Tehran')._utcoffset.total_seconds()/3600.0
3.433333333333333
>>> pytz.timezone('Asia/Tehran')._utcoffset.total_seconds()
12360.0
I wonder if that _utcoffset
attribute is used in utcoffset()
method, why the method is working while the attribute is wrong.
Looks like a bug anyway.
Nothing changes if you replace Asia/Tehran
with Iran
>>> print pytz.VERSION
2012c
OS: Linux Mint 15 (Olivia)
Using Python 2.7