-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Description
Version
v16.18.0
Platform
uname -a
Linux mostafa-pc 6.0.0-x64v2-xanmod1 #0~20221003.git3325905 SMP PREEMPT_DYNAMIC Mon Oct 3 21:25:40 UT x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
const now = new Date();
const formatter = new Intl.DateTimeFormat('en-US', {
timeZone: 'Asia/Tehran',
timeZoneName: 'short'
});
const timezone = formatter.formatToParts(now).find(part => part.type === 'timeZoneName').value;
console.log(timezone); // GMT+4:30
It should be GMT+3:30
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
It should be GMT+3:30
but I see: GMT+4:30
Additional information
I am experiencing an issue with the timezone data in Node.js. Even though I have updated the tzdata package on my Ubuntu system, Node.js is still showing incorrect time for the Asia/Tehran timezone. I have checked that the system time on Ubuntu is correct, and I have also tested with the toLocaleString method in Node.js to verify that it is using the correct timezone name. However, the time displayed by Node.js is still off by +4.30 hours.
I have found that this issue was discussed in this GitHub issue (nodejs/help#1843) and it seems that Node.js obtains its timezone data from the ICU library, which is periodically updated with its own tzdata. I believe that this issue was fixed in Node.js v16.18.0 (#44283), but I am experiencing the issue in Node.js v14.17.3.