Re: [Datetime-SIG] Add a strftime/strptime code for timezone ID
Where would the tzid come from? It's not a standard feature of tzinfo, so wouldn't that involve changing the tzinfo API as well? On November 2, 2016 2:33:50 PM EDT, Alexander Belopolsky <alexander.belopolsky@gmail.com> wrote:
I propose to add a code %/ to strftime/strptime to print/parse the timezone name (tzid) such as Australia/Sydney or America/New_York.
While the choice of code character can be debated, I like "/" because it is visually similar to "Z", can be associated with the Area-Region separator in the IANA timezone names and is unlikely to conflict with any other code.
On Wed, Nov 2, 2016 at 3:15 PM, Paul G <paul@ganssle.io> wrote:
Where would the tzid come from?
Hmm, I was actually thinking of the time module strftime where %/ can simply print the value of the TZ environment variable or the system local zone setting (which may be tricky to obtain, which is another reason to do it in stdlib.)
It's not a standard feature of tzinfo, so wouldn't that involve changing the tzinfo API as well?
Yes, to add this to datetime.strftime(), we will need to extend the tzinfo API. I have to think some more before making a specific proposal. Any suggestions? I think this was discussed a few years ago. I'll try to find the relevant threads.
participants (2)
-
Alexander Belopolsky -
Paul G