[New-bugs-announce] [issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

James Henstridge report at bugs.python.org
Tue Feb 17 05:33:26 CET 2009


New submission from James Henstridge <james at jamesh.id.au>:

The datetime module does not support time zones whose offset from UTC is
not an integer number of minutes.

The Olson time zone database (used by most UNIX systems and Mac OS X)
has a number of time zones with historic offsets that use second
resolution (from before those locations switched to a rounded offset
from GMT).

If you are working purely with the Python date time module, you can
round these offsets to whole numbers of minutes and get consistent
results (this is what the pytz module does), there are problems if you
want to interact with other programs using the Olson database.

As an example, PostgreSQL can return dates with sub-minute UTC offsets
and it would be nice to be able to represent them exactly.

The documentation doesn't explain why offsets need to be a whole number
of minutes, and the interface (returning timedeltas) doesn't look like
it'd need changing to support second offsets.  I wouldn't expect any
more complexity in the code to support them either.

----------
components: Extension Modules
messages: 82299
nosy: jamesh
severity: normal
status: open
title: tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)
versions: Python 2.7, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5288>
_______________________________________


More information about the New-bugs-announce mailing list