[Python-ideas] lack of time zone support

Bill Janssen janssen at parc.com
Wed Jun 2 03:18:28 CEST 2010

Brett Cannon <brett at python.org> wrote:

> First of all, there will never be a timezone table in the stdlib,
> period. This has been brought up before and is always shot down
> because python-dev does not want to have to keep track of timezone
> changes. pytz and other modules fit that bill fine.

Sure, sure.  Though I'm not sure that it has to be "in" the standard
library to be part of the standard library.  Past time for CPython to
start thinking about on-demand data, pulled dynamically from "the
cloud", with a static version for backup.  Just a thought...

> Now if you want UTC, that's different. Alexander already linked to an
> issue that is discussing that end. The current proposal is to provide
> a generic class that creates fixed UTC-offset timezones, with an
> instance for UTC set on the datetime module.

Yes, I've been following that.  Very promising.

> If you get that class in, you could then patch _strptime to support
> the %z directive so as to return a timezone that had a set UTC-offset.
> Not optimal, but it's something.

Yes, exactly.

> Otherwise you would need to patch _strptime to simply consume the
> number which I don't think anyone wants.



More information about the Python-ideas mailing list