1

With regard to my previous question on how to manage timezone specific date as well as manage their conversions, I have been trying to think of a way to be able to get updated timezone information that reflects the latest possible data of the iana tz db.

Since I'm using nodejs, my options was to use a library that dealt with timezones.
I found the following type of libraries, and I have queries related to each one:

  1. That use the Intl api, and maintain/package no timezone information themselves(libraries include date-fns-tz, day.js):

    • First page of date-fns-tz says:

      Time zone support for date-fns v2.0.0 using the Intl API. By using the browser API no time zone data needs to be included in code bundles. Modern browsers and Node.js all support the necessary features, and for those that don't a

    • As far as I can see, they dependent on nodejs itself managing the timezone data, which in turn depends on the ICU library, which doesn't seem to be updated quite often even though nodejs version itself gets updated. Question a., is this a correct deduction, or do they query some external servers(user's system/remote etc)?
  2. Libraries that rollout their own compilation of tzdb (moment-timezone):
    They seem to update quite periodically, but, in the particular case of moment-timezone, it seems to be an addon for moment, but, they both seem to be legacy project, and the homepage itself suggests not using it.

The best option for me would be the option number 2. But, as you can see above, I'd like to avoid using a legacy project. So, my Question b. would be for a suggestion for a method to get the most updated timezone information for use in nodejs(possibly another library suggestion or something else)

juztcode
  • 1,196
  • 2
  • 21
  • 46

1 Answers1

-1

So, my Question b. would be for a suggestion for a method to get the most updated timezone information for use in nodejs(possibly another library suggestion or something else)

I personally used moment for years but when it was classified as a legacy project, I switched to dayjs with the timezone plugin. Hope it helps

Day.js supports time zone via the Internationalization API in supported environments. By using the native API, no extra bytes of timezone data need to be included in code bundle. The list of all time zone names can be fount in the IANA database.

FurtiveStranger
  • 125
  • 1
  • 10
  • hey, thanks for replying , but, my question stated confusion about the updated information of timezone that Intl api gave us (pt no 1, bullet 1 &2 ) above, that is something that dayjs is not clear on – juztcode Dec 13 '22 at 16:13
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 19 '22 at 06:09