How to get UTC offset for non-standard time zone names?

Skip Montanaro skip at pobox.com
Sun Jan 31 12:29:57 EST 2010


> Would it hurt if you put in some extra information?
> http://www.timeanddate.com/library/abbreviations/timezones/

In theory, no.  At work we still use the ancient Rogue Wave C++
libraries in a number of applications.  It has hard-coded timezone
info so when the US changed the start and end of daylight savings
a few years ago we adapted by switching from US/Central to
either CDT5 or CST6 for a week around each entry/exit.
For those couple weeks our TZ environment variable is set to
one of those two values.

I could hard-code a similar exception in my Python code, but it
also has to run in London and New York (at least).  In the past
we've had offices in Hawaii and Asia, so I'd really like it if my
code was location-independent.

Skip

P.S.  Thanks for the compliment on my nickname.  My first name
is actually George.  Still impressed? ;-)





More information about the Python-list mailing list