iamkun / iamkun/dayjs

timezone output wrong result

Open
#2,601 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.