3 ms·
> Pretty sure pytz will hand you the appropriate timezone for a given date. Correct, or more precisely for a given timezone it will use the correct offset depe
by masklinn 10y ago
> Pretty sure pytz will hand you the appropriate timezone for a given date.
Correct, or more precisely for a given timezone it will use the correct offset depending on the date being converted:
>>> format_datetime(datetime.datetime(2011, 12, 15, 10, 5, 18, tzinfo=berlin).astimezone(samoa), 'full')
Wednesday, 14 December 2011 at 23:12:18 Apia Daylight Time
>>> format_datetime(datetime.datetime(2012, 1, 15, 10, 5, 18, tzinfo=berlin).astimezone(samoa), 'full')
Sunday, 15 January 2012 at 23:12:18 Apia Daylight Time