[Datetime-SIG] Add a strftime/strptime code for timezone ID

M.-A. Lemburg mal at egenix.com
Thu Nov 3 10:57:56 EDT 2016


On 03.11.2016 15:20, Alexander Belopolsky wrote:
> On Thu, Nov 3, 2016 at 12:38 AM, Random832 <random832 at fastmail.com> wrote:
> 
>> On the IANA side of things, the tzid is not intended to be displayed as
>> a human-readable way to identify the timezone (and this is used to
>> rebuff demands by users to create tzids for cities like Brasilia and
>> Beijing that people want to see represented over Sao Paulo and Shanghai)
>>
>> What is the reason for wanting this?
>>
> 
> My proposal was indeed prompted by the recent discussion on the IANA
> mailing list about human readable abbreviations being changed to numeric
> codes.  It is not uncommon for people to display timezones with '%Z %z'
> format which with recent changes would result in "+10 +1000" for say
> Asia/Vladivostok.  With the proposed %/ code, "%/ %z" would print
> "Asia/Vladivostok +1000" which looks like an improvement even over the
> original "VLAT +1000".
> 
> The results of strftime() are not necessarily intended for displaying
> directly to end users.  An application can have an extra layer that
> translates tzids for display and the raw tzids may be useful for saving
> times in text files or a database.

I don't think Python should enter this mine field. Users will
typically only write their own timezone abbreviation (if at all) and
also expect this as output.

Still, parsing is complicated:

Users often get it wrong, e.g. write CET in summer or CEST in
winter. Additionally, the timezone codes overlap, e.g. BST can refer
to British Standard Time, but also to Bangladesh Standard Time:

https://www.timeanddate.com/time/zones/

For machine interfacing, the timezone offset is more reliable
and location shouldn't really be part of the time data anyway,
but instead be handled in separate data fields.

Could you provide a pointer to the proposal to change %Z to
anything other than a timezone name abbreviation ?

This sounds like a misguided change to me :-) If anything, a new
marker should be introduced to output or parse the TZID.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Nov 03 2016)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> Python Database Interfaces ...           http://products.egenix.com/
>>> Plone/Zope Database Interfaces ...           http://zope.egenix.com/
________________________________________________________________________

::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
                      http://www.malemburg.com/



More information about the Datetime-SIG mailing list