-
Notifications
You must be signed in to change notification settings - Fork 833
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
moment.tz.names() - Possibly discrepencies between IANA tzdata and library's list #159
Comments
Running a
It would be great if moment-timezone's API, |
More digging and found some explanation:
@timrwood Is the reason we are using zone.tab to create our meta json, is to support backward-compatibility with older programs? |
I did not know about I think we should switch the |
Closed with #162 |
It seems like there is some sort of discrepency between the list of timezones returned by the API
moment.tz.names()
and those provided by IANA.Below are my findings when i was looking to create a list of timezones for end-users to choose from:
(All data is with reference to latest tzdata: 2014j)
moment.tz.names()
returns list of timezone names supported by our library.Total zones count returned by the API: 582
https://github.com/moment/moment-timezone/blob/develop/data/meta/2014j.json
Array length of above json: 416
Total zones count from above IANA file: 336
There definitely looks like something is odd as none of them match. On inspecting further, here are a few explanations for the discrepancy.
moment.tz.names()
lists ALL possible timezone names,i.e,a) it includes historical zones which maybe practically not used much. eg: Etc/GMT-14, Etc/GMT-13, Etc/GMT-12 etc.
b) it has a separate array entry for zones which are actually linked to each other.
eg: "Asia/Kathmandu", "Asia/Katmandu".
But then, the list present in 2) and 3) above should have atleast matched. The data present in meta/2014j.json has meta data about each zone, and it doesn't have timezones like Etc/GMT+xx which do not map to any country. Hence, atleast the timezone count of this, should have been same as that of IANA zone1970.tab.
Another example of mismatch:
Last entry in the JSON array in meta/2014j.json has a zone for "Africa/Harare", mapped to country code "ZW".
Per IANA zone1970.tab, there is no zone named "Africa/Harare" !!!
Mayber i'm missing something, but thought its worth to bring this up here.
Will keep digging into this to see if i can find some explanation/clues.
The text was updated successfully, but these errors were encountered: