Re: Confused about timezones

2013-10-23 Thread Ethan Furman
On 10/23/2013 12:00 PM, Skip Montanaro wrote: > --> LOCAL_TZ.localize(dt1).utcoffset() datetime.timedelta(-1, 68400) --> LOCAL_TZ.localize(dt2).utcoffset() datetime.timedelta(-1, 64800) Why is the UTC offset the same for both datetime objects despite the presence/absence of Daylight Savings?

Re: Confused about timezones

2013-10-23 Thread Skip Montanaro
LOCAL_TZ.localize(dt1).utcoffset() > datetime.timedelta(-1, 68400) LOCAL_TZ.localize(dt2).utcoffset() > datetime.timedelta(-1, 64800) > > Why is the UTC offset the same for both datetime objects despite the > presence/absence of Daylight Savings? Brain freeze! A quick glance told me they

Confused about timezones

2013-10-23 Thread Skip Montanaro
This isn't really a Python issue, though my problem solution will be implemented in Python. If I have a naive datetime object for some time in the past, it's not clear to me how the offset gets set correctly. Consider this sequence: >>> import datetime, pytz >>> LOCAL_TZ = pytz.timezone(os.environ