Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mwittig opened this issue Apr 3, 2019 · 4 comments

Comments

@mwittig
Copy link

@mwittig mwittig commented Apr 3, 2019

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

@mwittig mwittig changed the title How does Node.js obtain IANA Timzone data? How does Node.js obtain IANA Timezone data? Apr 3, 2019
@bnoordhuis

This comment has been minimized.

Copy link
Member

@bnoordhuis bnoordhuis commented Apr 8, 2019

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.

@mwittig

This comment has been minimized.

Copy link
Author

@mwittig mwittig commented Apr 8, 2019

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?

@bnoordhuis

This comment has been minimized.

Copy link
Member

@bnoordhuis bnoordhuis commented Apr 9, 2019

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

@mwittig

This comment has been minimized.

Copy link
Author

@mwittig mwittig commented Apr 10, 2019

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

@mwittig mwittig closed this Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.