timezone output wrong result
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Demo code:
let time = dayjs().tz('Asia/Ho_Chi_Minh');
console.log('Asia/Ho_Chi_Minh: ' + time.format('HH:mm'));
time = time.tz('Asia/Singapore');
console.log('Asia/Singapore: ' + time.format('HH:mm'));
output:
Asia/Ho_Chi_Minh: 00:30
Asia/Singapore: 02:30
Expected behavior
output:
Asia/Ho_Chi_Minh: 00:30
Asia/Singapore: 01:30
The differences should only be 1 hour. The same code used to result correct time but suddenly became incorrect
Information
- Day.js Version: 1.11.10
- OS: Linux
- Browser: Nodejs v21.4.0
- Time zone: GMT-5 Central Daylight Time (CDT)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by running the supplied Day.js timezone example under Node.js and trace the timezone conversion path; done means Asia/Ho_Chi_Minh remains 00:30 while Asia/Singapore is 01:30, with the one-hour difference preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100