Incorrect behavior of `dayjs.tz`
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
```ts
const date = new Date() // utc timezone date
// 2024-09-04T10:04:12.774Z
dayjs.tz(date, "Asia/Kolkata").toISOString()
// 2024-09-04T10:04:12.774Z
dayjs.tz(date.toISOString(), "Asia/Kolkata").toISOString()
// 2024-09-04T04:34:12.774Z
```
**Expected behavior**
```ts
dayjs.tz(date, "Asia/Kolkata").toISOString()
// 2024-09-04T04:34:12.774Z
```
**Information**
- Day.js Version: v1.11.13
- OS: macOS
- Browser: Node.js
- Time zone: UTC
Contributor guide
Research direction
Start by reproducing the two dayjs.tz examples from the issue in Node.js with the timezone set to UTC, comparing Date and ISO string inputs for Asia/Kolkata. Trace the dayjs.tz entry point and timezone handling, then verify that both inputs produce the expected 2024-09-04T04:34:12.774Z result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100