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

Incorrect time shown in Node.js for timezone "Asia/Tehran" in 14.17.3 #47250

Closed
mostafa8026 opened this issue Mar 25, 2023 · 1 comment
Closed

Comments

@mostafa8026
Copy link

mostafa8026 commented Mar 25, 2023

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.

@mostafa8026
Copy link
Author

I would like to apologize for any inconvenience I may have caused by submitting an issue for Node.js regarding the incorrect display of time. After further research and investigation, it seems that the issue has been fixed in the latest LTS version of Node.js (14.21.3). I appreciate your time and effort in addressing this matter.

Thank you and have a great day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant