DST and datetime

Ben Finney ben+python at benfinney.id.au
Wed Dec 30 15:35:12 EST 2009


"W. eWatson" <wolftracks at invalid.com> writes:

> =============Program================
> from datetime import datetime, timedelta
> import time
>
> DST_dict = { # West coast, 8 hours from Greenwich for PST
>          2007:("2007/03/11 02:00:00", "2007/11/04 02:00:00"),
>          2008:("2008/03/09 02:00:00", "2008/11/02 02:00:00"),
>          2009:("2009/03/08 02:00:00", "2009/11/01 02:00:00"),
>          2010:("2010/03/14 02:00:00", "2010/11/07 02:00:00")}

Or you could use the ready-made wheel maintained by others:

    tzinfo Objects
    <URL:http://docs.python.org/library/datetime.html#tzinfo-objects>

    World timezone definitions, modern and historical
    <URL:http://pypi.python.org/pypi/pytz>

-- 
 \              “Ignorance more frequently begets confidence than does |
  `\           knowledge.” —Charles Darwin, _The Descent of Man_, 1871 |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list