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

Add Windows display names #50

Closed
mattjohnsonpint opened this issue Nov 15, 2018 · 12 comments
Closed

Add Windows display names #50

mattjohnsonpint opened this issue Nov 15, 2018 · 12 comments

Comments

@mattjohnsonpint
Copy link
Owner

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
Copy link
Owner Author

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

@federicoce-moravia
Copy link

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
Copy link

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
Copy link
Owner Author

mattjohnsonpint commented Mar 3, 2019

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:

  • BaseUtcOffsetMinutes and SupportsDaylightSavingTime aren't useful by themselves, as one also needs to know exactly when DST applies and the year-over-year changes. Also, they aren't localized so if one wants them they can be pulled directly from a TimeZoneInfo object (at least on Windows).
  • StandardName and DaylightName are indeed strings that Windows localizes, but they're very poorly maintained. I usually recommend they not be used anywhere. Lots of bad data here, such as "Russia TZ 2 Standard Time" and "GMT Daylight Time".
  • Id - is in the data twice, and is only needed once
  • LCID - Doesn't hurt anything, but I'm not sure they are needed beyond the actual lookup

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
Copy link
Owner Author

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

@tomkludy
Copy link

tomkludy commented Mar 4, 2019

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

@sonergonul
Copy link

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
Copy link
Owner Author

Awesome work! Thank you!

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

@mattjohnsonpint
Copy link
Owner Author

This is complete in version 4.0.0.

@mattjohnsonpint
Copy link
Owner Author

@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
Copy link

Great job @mj1856 and @tomkludy. Well done!

@paulisfluent
Copy link

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.

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

5 participants