mattjohnsonpint / TimeZoneNames

Provides a complete source of localized time zone names and abbreviations.
MIT License
196 stars 32 forks source link

Add Windows display names #50

Closed mattjohnsonpint closed 5 years ago

mattjohnsonpint commented 5 years ago

Per comments in https://stackoverflow.com/q/53300222/634824

It would be useful for cross-plat scenarios to have a way to return Windows display names.

mattjohnsonpint commented 5 years ago

Also this one: https://stackoverflow.com/q/54758449/634824

federicoce-moravia commented 5 years ago

Currently figuring out how to make Windows and Linux-based microservices agree on the timezones we're dealing with, so this is definitely good news to me.

tomkludy commented 5 years ago

Check out https://github.com/tomkludy/TimeZoneWindowsResourceExtractor;

Or, just grab the output file.

https://raw.githubusercontent.com/tomkludy/TimeZoneWindowsResourceExtractor/master/TZResScraper/tzinfo.json.

I expect this to change occasionally, so I am currently working on some automation to run this once a month or so, and upload the output file to a CDN. That part isn't done, but let me know if you think this would be worthwhile.

mattjohnsonpint commented 5 years ago

This looks really promising, and is essentially the approach I was considering. Looks like you've done all the hard work for me. Thanks!

Rather than monthly, I suggest regularly checking the Windows DST/TZ blog and/or subscribing to its RSS feed, to know when there are new time zones or changes to the time zone strings.

Also, while I appreciate you extracting all the information you can, I'd be careful about usage of some of the fields:

So basically, the resulting data needed (at least for this project) would be:

    {
      "Locale": "en-US",
      "TimeZones": {
        "Dateline Standard Time": "(UTC-12:00) International Date Line West",
        "UTC-11": "(UTC-11:00) Coordinated Universal Time-11",
        "Aleutian Standard Time": "(UTC-10:00) Aleutian Islands",
        ...

Of course, feel free to leave as is if you like, but that's all that I would want to extract from your output.

mattjohnsonpint commented 5 years ago

Also, please add a license to your project, so I can use it. :)

tomkludy commented 5 years ago

Great information and suggestions. I updated to match your suggested format, and dropped the rest (which I also was not using).

sonergonul commented 5 years ago

Check out https://github.com/tomkludy/TimeZoneWindowsResourceExtractor;

Or, just grab the output file.

https://raw.githubusercontent.com/tomkludy/TimeZoneWindowsResourceExtractor/master/TZResScraper/tzinfo.json.

I expect this to change occasionally, so I am currently working on some automation to run this once a month or so, and upload the output file to a CDN. That part isn't done, but let me know if you think this would be worthwhile.

That's a really nice work @tomkludy, thank you. I also regularly follow Microsoft DST/TZ blog, so whenever they change something, I would like to contribute your TimeZoneWindowsResourceExtractor project.

Again, thanks.

mattjohnsonpint commented 5 years ago

Awesome work! Thank you!

I will use your data to complete this feature sometime in the next week or so.

mattjohnsonpint commented 5 years ago

This is complete in version 4.0.0.

mattjohnsonpint commented 5 years ago

@tomkludy - thanks again for providing the Windows display names. I credited you in the readme accordingly.

Feel free to open an issue or PR any time you have updated data. (which should correspond to announcements on the MS DST/TZ Blog).

sonergonul commented 5 years ago

Great job @mj1856 and @tomkludy. Well done!

paulisfluent commented 5 years ago

Thanks @mj1856 and @tomkludy ! As the asker of https://stackoverflow.com/q/53300222/634824 I'll hopefully get a chance to use this new feature in our project soon.