Improving support for timezones in Python (was: UTC "timezone" causing brain explosions)

Ben Finney ben+python at benfinney.id.au
Thu Jan 30 21:26:29 EST 2014


Ben Finney <ben+python at benfinney.id.au> writes:

> Time zones are a hairy beast to manage, made all the more difficult
> because national politicians continually fiddle with them which means
> they can't just be a built-in part of the Python standard library.

PyCon 2013 had a good talk on calendaring and timezone issues
<URL:http://www.pyvideo.org/video/1765/blame-it-on-caesar-what-you-need-to-know-about-d>
(video at <URL:https://www.youtube.com/watch?v=GBKqRhn0ekM>).

The speaker, Lennart Regebro, maintains a library for getting the local
timezone <URL:https://pypi.python.org/pypi/tzlocal>, and is currently
working on a PEP to improve timezone support directly in the standard
library <URL:http://www.python.org/dev/peps/pep-0431/>.

He also reinforces the message that UTC is the canonical timezone for
storing and manipulating timestamp values, and we should be converting
to/from those canonical values as early/late as possible in our programs.

-- 
 \     “Reality must take precedence over public relations, for nature |
  `\                            cannot be fooled.” —Richard P. Feynman |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list