iamkun / iamkun/dayjs

Hi team, wrong result of timezone function

Open
#2,851 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

here's sample code

```javascript
// use utc, time zone plugins
// case 1 wrong result
dayjs.tz('2025-03-24T11:00:00', 'Asia/Seoul').utcOffset(8).format()
// => '2025-03-24T09:00:00+08:00'
// case 2 correct result
dayjs(dayjs.tz('2025-03-24T11:00:00', 'Asia/Seoul').format()).utcOffset(8).format()
// => '2025-03-24T10:00:00+08:00'
```

**Information**
- Day.js Version: 1.1.13
- OS: macOS
- Browser : Chrome 134
- Time zone: Asia/Shanghai

Contributor guide

Open the contributing guide

Research direction

Start by running the two JavaScript examples from the issue with the UTC and timezone plugins enabled, using Asia/Seoul and the requested UTC offset. Compare the differing formatted results and trace the timezone and utcOffset handling. Done means the equivalent calls produce the expected consistent time and offset.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
internationalization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.