[Python-Dev] datetime module enhancements

Tristan Seligmann mithrandi-python-dev at mithrandi.za.net
Sun Mar 11 01:18:36 CET 2007


* Christian Heimes <lists at cheimes.de> [2007-03-10 03:58:27 +0100]:

> >From the README.txt
> pytz brings the Olson tz database into Python. This library allows
> accurate and cross platform timezone calculations using Python 2.3
> or higher. It also solves the issue of ambiguous times at the end
> of daylight savings, which you can read more about in the Python
> Library Reference (datetime.tzinfo). Amost all (over 540) of the Olson
> timezones are supported.

Unfortunately, it would appear that the Olson tz database contains some
rather... uh... confusing data. For example:

>>> pytz.timezone('Africa/Johannesburg')
<DstTzInfo 'Africa/Johannesburg' SAST+1:30:00 STD>
# SAST is UTC+2 not UTC+1.5

>>> pytz.timezone('Etc/GMT+2')._utcoffset
datetime.timedelta(-1, 79200)
# I thought I asked for GMT+2, not GMT-2
-- 
mithrandi, i Ainil en-Balandor, a faer Ambar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/python-dev/attachments/20070311/674981ce/attachment.pgp 


More information about the Python-Dev mailing list