datedatetimetimezonedstluxon

Timezone and DST calculation in date/time libraries


I am using specifically Luxon. However this question applies to all date/time libraries.

What happens if a country (say the USA) decides to remain in DST the whole year? To the point, libraries must contain a list of timezones and DST dates. If DST changes for a country, does a new version of the library need to be published with the updated DST values?


Solution

  • It depends on the library.

    Some libraries bundle their own time zone data and needed to be updated regularly to receive such updates. Examples include:

    Other libraries take their time zone data from from the host environment they run within, which might in-turn take their time zone data from a library, or from the host OS. Examples include:

    These lists are not intended to be comprehensive.

    The ultimate source of the data is usually the IANA TZ Database. All libraries that ship their own time zone data derive it from there.

    However, Microsoft also still maintains time zone data for Windows separately. It is still used by .NET on Windows platforms, and other older Windows technologies such as Win32 APIs.