Thanks to Simeon for your reply. It made me realize how shallow my understanding of all this is. The following experiments lost me a little more ...
>>> import datetime, pytz >>> date_paris = datetime.datetime(2013,9,3,16,0, tzinfo=pytz.timezone("Europe/Paris")) >>> date_utc = datetime.datetime(2013,9,3,16,0, tzinfo=pytz.utc) >>> date_paris.astimezone(pytz.utc) datetime.datetime(2013, 9, 3, 15, 51, tzinfo=<UTC>) >>> date_utc.astimezone(pytz.timezone("Europe/Paris")) datetime.datetime(2013, 9, 3, 18, 0, tzinfo=<DstTzInfo 'Europe/Paris' CEST+2:00:00 DST>)
Why does this 9-minute shift appear when converting in one direction, but not in the other? The following piece of code concentrates all the frustration:
>>> date_paris datetime.datetime(2013, 9, 3, 16, 0, tzinfo=<DstTzInfo 'Europe/Paris' PMT+0:09:00 STD>) >>> date_paris.astimezone(pytz.utc).astimezone(pytz.timezone("Europe/Paris")) datetime.datetime(2013, 9, 3, 17, 51, tzinfo=<DstTzInfo 'Europe/Paris' CEST+2:00:00 DST>)