[Cialug] Python and timezones, or lack thereof

Matthew Nuzum newz at bearfruit.org
Fri Jan 2 07:45:25 CST 2009


On Thu, Jan 1, 2009 at 4:57 PM, Colin Burnett <cmlburnett at gmail.com> wrote:
> I'm doing some date work in Python and have discovered Python's
> attitude toward timezones as rather......unimpressive:
>
> "Note that no concrete tzinfo classes are supplied by the datetime
> module. Supporting timezones at whatever level of detail is required
> is up to the application." --
> http://docs.python.org/library/datetime.html
>
> I interpret that as meaning they don't even want to *try* (can't
> entirely blame them) so if I want to deal with timezones I'm 100% on
> my own.  Spiffy!  It would seem that pytz
> (http://pytz.sourceforge.net/) is my new best friend.
>
>
> Any comments/suggestions?

A friend/coworker wrote a really awesome date handling library that
can handle time zones. Its open source and generally pretty highly
regarded. I've not used the timezone portion of it but I have used
other feature of this module and felt it was well thought out and
implemented. maybe it can help you:

http://niemeyer.net/python-dateutil (look for the tz module)

-- 
Matthew Nuzum
newz2000 on freenode, skype, linkedin and twitter


More information about the Cialug mailing list