Skip to content

How does Node.js obtain IANA Timezone data? #1843

Closed

Description

@mwittig

Node.js Version: v10.15.3 (LTS)
OS: All Operating Systems
Scope: Code / Install
Module: Internal Handling of IANA Timezone Data

I would like to know how Node.js obtains IANA timezone data. In particular, I'd would like to know whether Node.js uses its own copy of timezone data as part of the Node.js installation, or it accesses timezone data provided with the OS.

Why is this important? The IANA timezone database is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight-saving rules (latest update March 25th 2019). So, when the data changes do I need update the Node.js version installed or is it good enough to take care of OS updates?

A related question: Does the Node.js code uses the ICU library to access timezone data or does it use/implement a different library/module for this purpose?

See also: https://www.iana.org/time-zones

Activity

  1. changed the title [-]How does Node.js obtain IANA Timzone data?[/-] [+]How does Node.js obtain IANA Timezone data?[/+] on Apr 3, 2019
  2. bnoordhuis commented on Apr 8, 2019

    @bnoordhuis
    Member

    Node.js gets its timezone data from ICU and ICU has its own tzdata, it doesn't query external files or the operating system.

    The copy of ICU that is bundled with Node.js is periodically updated.

  3. mwittig commented on Apr 8, 2019

    @mwittig
    Author

    Thank you very much for the feedback.

    What, if Node.js has been built with the "system-icu" flag? As the Node.js uses a pre-installed icu library in this case, would it be possible to update that library independently from Node.js?

  4. bnoordhuis commented on Apr 9, 2019

    @bnoordhuis
    Member

    Yes, that should work. The system-icu flag links Node.js to ICU dynamically rather than statically.

  5. mwittig commented on Apr 10, 2019

    @mwittig
    Author

    Thanks you very much again for answering my questions. I am closing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions