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

Handle "special zones(eg: America/Montreal)" mentioned in checktab.awk file of iana tz database #176

Closed
kashifshamaz21 opened this issue Jan 20, 2015 · 5 comments

Comments

@kashifshamaz21
Copy link
Contributor

@timrwood @mj1856 Need your attention on this one! And bare with me, this is going to be a long description.

The official IANA tzdata has a file by name checktab.awk. In this file, since 2013 (this commit : eggert/tz@2022cdd),
there are entries that have been added for some timezones considered as "special cases".
Question: What is special about these zones?
Answer: These special zones are mentioned with a tzdata["Some/zoneName"] = 1 harcoding in the checktab.awk file. The anomaly with these zones is that, their data is found in one of the continent files(africa, asia, america etc.) BUT they don't have an entry about their country mapping in zone1970.tab. The country mapping for these zones is present in zone.tab, which is supposed to deprecated and not used by newer applications.
For example, in the latest tz database version 2014j, the checktab.awk file has following lines:

    # A special (and we hope temporary) case.
    tztab["America/Montreal"] = 1

    # Some more special cases; these are zones that should probably
    # be turned into links.
    if (zone_table == "zone1970.tab") {
      tztab["America/Antigua"] = 1
      tztab["America/Cayman"] = 1
      tztab["Asia/Aden"] = 1
      tztab["Asia/Bahrain"] = 1
      tztab["Asia/Kuwait"] = 1
      tztab["Asia/Muscat"] = 1
      tztab["Pacific/Midway"] = 1
      tztab["Pacific/Saipan"] = 1
    }

Question: How does it affect timezone handling, or moment-timezone in general?
Answer: Moment-timezone has a data-meta grunt task which generates a map of countries and for each country, it has a array of zones followed in that country.
For the above "special zones", they won't be mentioned in zones array of any country. Something like a zombie zone, which doesn't belong to any country, when in reality they all have a country in which they are followed.

Question: Which all versions of tzdata have these special zones?
Answer: Starting from 2013e onwards, these special zones make their appearance.

Question: Whats the deal with America/Montreal?
Answer: The America/Montreal zone is even more wierd, in that, this doesn't even have an entry in zone.tab file. Which leaves all consumers of tzdata with absolutely no clue, as to which country to associate with this zone. So, this needs to have an explicit country assigned to it, in the data-meta task. It belongs to Canada.

You can read about a similar discussion on this issue here: tzinfo/tzinfo-data#2

Huh, thats probably one of the longest issue description in github!!! Phew!
Btw, i'm working on resolving this wierd problem and will send in a PR soon. Till then, jump in with your thoughts. I think we can handle this scenario in the grunt data-meta task.

kashifshamaz21 added a commit to kashifshamaz21/moment-timezone that referenced this issue Jan 29, 2015
….awk" file, which got added from verion 2014g onwards.
@kashifshamaz21
Copy link
Contributor Author

@timrwood Pushed a fix for this issue as part of pull request: #175
Commit in which this issue is fixed: kashifshamaz21@2f95e6e

@vincentcr
Copy link

is this the reason why require('./data/meta/latest.json').zones['America/Montreal'] is undefined?

@kashifshamaz21
Copy link
Contributor Author

@vincentcr Yes, this is the very reason. America/Montreal has been treated as a special case by IANA since the 2013e version of the database. But this should get fixed once the PR #175 is merged.

@mattjohnsonpint
Copy link
Contributor

@timrwood @kashifshamaz21 - FYI: 2015c finally made America/Montreal a link to America/Toronto.

@gilmoreorless
Copy link
Member

All of the zones listed in the opening post are now in the standard tzdb data as links.

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

4 participants