Closed mattjohnsonpint closed 5 years ago
Also this one: https://stackoverflow.com/q/54758449/634824
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.
Check out https://github.com/tomkludy/TimeZoneWindowsResourceExtractor;
Or, just grab the output file.
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.
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 onceLCID
- Doesn't hurt anything, but I'm not sure they are needed beyond the actual lookupSo 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.
Also, please add a license to your project, so I can use it. :)
Great information and suggestions. I updated to match your suggested format, and dropped the rest (which I also was not using).
Check out https://github.com/tomkludy/TimeZoneWindowsResourceExtractor;
Or, just grab the output file.
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.
Awesome work! Thank you!
I will use your data to complete this feature sometime in the next week or so.
This is complete in version 4.0.0.
@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).
Great job @mj1856 and @tomkludy. Well done!
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.
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.