iamkun / iamkun/dayjs

Daylight Savings Weirdness

Open
#2,960 0 comments 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

```
> dayjs(1762074000*1000).tz("America/Los_Angeles").format()
'2025-11-02T01:00:00-09:00' // ... there is never -0900 in America/Los_Angeles

>dayjs((1762074000+3599)*1000).tz("America/Los_Angeles").format()
'2025-11-02T01:59:59-09:00' // ... still wrong for the whole hour where times overlap

>dayjs((1762074000+3600)*1000).tz("America/Los_Angeles").format()
'2025-11-02T02:00:00-08:00' // this is the correct offset that should have been reported above

>dayjs((1762074000-1)*1000).tz("America/Los_Angeles").format()
'2025-11-02T01:59:59-07:00' // this is the correct offset for this time

```

America/Los_Angeles goes from -0700 to -0800 ... but during the window from 1 to 2 (where all the times basically repeat it reports as -0900 ... which is never correct for America/Los_Angeles

once it reaches 02:00 it correctly reports as -0800, and prior to this timestamp it correctly reports -0700

it does not seem to happen for other timezones (at least not America/New_York)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the America/Los_Angeles examples in the issue and inspect Day.js timezone handling for the repeated 1:00–2:00 interval during the daylight-saving transition. Done means the reported offsets are valid for each timestamp, including the repeated hour, without changing correct behavior for the surrounding times or other timezones.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.