Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using deprecated time zone names as main group names? #153

Open
KevinNovak opened this issue Feb 27, 2021 · 2 comments
Open

Using deprecated time zone names as main group names? #153

KevinNovak opened this issue Feb 27, 2021 · 2 comments

Comments

@KevinNovak
Copy link

KevinNovak commented Feb 27, 2021

According to the The Wikipedia list of IANA time zones, the "America/Godthab" time zone has been deprecated and should be replaced with "America/Nuuk".

image

I noticed tzdb is using "America/Godthab" as one of the main time zone names.

EDIT: I noticed "Africa/Lome" is being used as the main name of the time zone group, even though it is an alias for "Africa/Abidjan".

I guess the question is, should deprecated time zone names be used as main group names? And secondly, should alias names be used as main group names? Should the group name not be the canonical one?

@KevinNovak KevinNovak changed the title "America/Godthab" is deprecated Using deprecated time zone names as main group names? Mar 8, 2021
@vvo
Copy link
Owner

vvo commented Mar 19, 2021

The group name should definitely be the main time zone name indeed, not the deprecated ones. I guess I missed that when I initially built the library.

Accepting PR solving this, thanks!

@vvo vvo added the pr-welcome label Mar 19, 2021
@KevinNovak
Copy link
Author

KevinNovak commented Mar 20, 2021

There are 3 sort of statuses a time zone name can be in (Wikipedia).

Canonical - The primary, preferred zone name.
Alias - An alternative name, which may fit better within a particular country.
Deprecated - An older style name, left in the tz database for backwards compatibility, which should generally not be used.

tzdb would need to be able to determine what status a name is in for this change, so I tried to hunt down how Wikipedia determined these statuses.

It seems that everything originates from the IANA Time Zone Database, and more specifically:

  • deprecated time zones - Come from the "backward" file.

    • Each "Link" in this file denotes a deprecated time zone change:
    • image
  • alias time zones - Come from each of the individual region files (such as "africa", "europe", etc.).

    • Each "Link" in these files, denotes an alias:
    • image

Based on IANA's download suggestions, we should be able to download the data with the following commands:

wget https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz
gzip -dc tzdata-latest.tar.gz | tar -xf -

It's also available directly through HTTPS here.

I imagine the tzdb's generate.js could download this data and use it where needed:

  1. Avoid deprecated/alias names as the main time zone group name.
  2. Add deprecated/alias names to the group list of time zones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants