[Python-Dev] Status on PEP-431 Timezones

Chris Angelico rosuav at gmail.com
Wed Apr 15 17:10:42 CEST 2015


On Thu, Apr 16, 2015 at 1:00 AM, Lennart Regebro <regebro at gmail.com> wrote:
> So because of this, perhaps we actually *should* change the internal
> representation to UTC, because that makes the issues I'm fighting with
> now so much simpler. (I'm currently trying to get arithmetic to do the
> right thing in all cases, which is crazy complicated).

If I understand you correctly, then, an aware datetime would represent
a unique instant in time (modulo relativity), coupled with some
metadata stating what civil timezone it should be understood in terms
of. This is the same as a PostgreSQL "timestamp with time zone" field,
and IMO is a pretty reliable way to do things. So count me as +1 for
this proposal.

Bikeshed: Would arithmetic be based on UTC time or Unix time? It'd be
more logical to describe it as "adding six hours means adding six
hours to the UTC time", but it'd look extremely odd when there's a
leap second.

ChrisA


More information about the Python-Dev mailing list