[Datetime-SIG] The BDFL's take

Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Jul 29 18:43:07 CEST 2015


On Wed, Jul 29, 2015 at 12:34 PM, Lennart Regebro <regebro at gmail.com> wrote:
> Anyway, you can't seriously consider that I have to set the TZ
> environment variable as a viable solution, can you?

It worked for most people so far given that the standards bodies are in now rush
updating the standards that assume one global timezone per process.  Note that
python exposes time.tzset() method so that you can switch timzones without
restarting the interpreter.

However, this problem has nothing to do with the datetime API.  If we find a
way to access the timezone database by better means than POSIX system
calls, we can easily extend astimezone method so that

>>> u.astimezone('Australia/Melbourne')

works when TZ=America/New_York or anything else.


More information about the Datetime-SIG mailing list