iamkun / iamkun/dayjs

Get one hour offset when time zone is America/New_York

Open
#2,837 0 comments 0 reactions 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**

Test in `https://day.js.org/` console

```
var a = dayjs.tz(undefined, 'America/New_York')
.set('year',2024)
.set('month', 8)
.set('date', 27)
.set('hour',3)
.set('minute',1)
.set('second',4)
a.format('YYYY-MM-DD HH:mm:ss z')
dayjs.tz(a.unix()*1000, 'America/New_York').format('YYYY-MM-DD HH:mm:ss z')
```

![Image](https://github.com/user-attachments/assets/fecf3d23-d098-41ff-986d-36ab1193f9a4)

**Expected behavior**

expect `dayjs.tz(a.unix()*1000, 'America/New_York').format('YYYY-MM-DD HH:mm:ss z')` to be `'2024-09-27 03:01:04 EDT'`

**Information**

- Day.js Version: 1.11.13
- OS: windows10
- Browser: 133.0.6943.142
- Time zone: America/New_York

Contributor guide

Open the contributing guide

Research direction

Start by running the provided reproduction in the Day.js web console with version 1.11.13 and the America/New_York timezone. Trace the timezone conversion involved in formatting the Unix timestamp, then confirm the result is exactly 2024-09-27 03:01:04 EDT.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.