mattjohnsonpint / SqlServerTimeZoneSupport

IANA Time Zone Support for Microsoft SQL Server
MIT License
193 stars 45 forks source link

UtcToLocal include "Spring Forward" and "Fall Back" DST Transition #22

Closed chunges closed 7 years ago

chunges commented 7 years ago

After evaluating both the "AT TIMEZONE" at SQL Server 2016, and this project using IANA/Olson TimeZone Database. One of the advantage of using IANA/Olson TimeZone database is it offers 'redefined, distinct time zones named from an examplar city, which is specific. Whereby compare to Microsoft Window TimeZone Database , the Time Zone is broad and ambigous. e.g. Europe/Oslo at IANA/Olson , but, at Microsoft Window Time Zone Database are as below :

  1. W. Europe Standard Time
  2. Central Europe Standard Time
  3. Central European Standard Time
  4. E. Europe Standard Time Which it is confuse when we want to convert utc time to Oslo local time on which timezone I should use ( commonly, Norway is North of Europe) . I think this project can provides usefulness when is able to convert UTC time to Local Time including the dates there are clock change. Thank you.
mattjohnsonpint commented 7 years ago

I'm not exactly sure what you are asking for here.

You may be interested in the CLDR Windows zone mappings file, and/or my TimeZoneConverter library.

srutzky commented 7 years ago

@mj1856 Related to your suggestion of looking at the Unicode.org mapping file, do you happen to know if the files located in C:\WINDOWS\Globalization\Time Zone are a reliable source of info? There is very little info out there about the nature of these files (if they are used and maintained). All I could find are two mentions: one from you -- https://groups.google.com/forum/#!msg/noda-time/jWyOTWJUCTA/kxJqUKSa-ywJ -- and one from me on DBA.SE ;-). On my Windows 10 machine the files have a date of 2016-09-02, which appears to be 6 versions out of date, if I am understanding the contents of ftp://ftp.iana.org/tz/ (even the "releases" folder) correctly. I guess this means that they should be ignored at this point? Thanks!

mattjohnsonpint commented 7 years ago

They are mostly reliable if you stay current with Windows updates. Mine are dated 2017-03-31.

But in general, there's no docs because there's no public contract for these files. Consider them "for internal use only". They could possibly disappear in a future version.

The public contracts that use this data are the UWP Windows.​Globalization.Calendar and Windows.​Globalization.​Date​Time​Formatting.Date​Time​Formatter APIs. You can use those safely, even if in a future version they pull data from elsewhere.