vvo / tzdb

🕰 Simplified, grouped and always up to date list of time zones, with major cities
MIT License
773 stars 53 forks source link

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

Open KevinNovak opened 3 years ago

KevinNovak commented 3 years ago

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?

vvo commented 3 years ago

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!

KevinNovak commented 3 years ago

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:

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.