iamkun / iamkun/dayjs

The "timezone" plugin does not parse the timestamp in seconds

Open
#2,388 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**
The "timezone" plugin does not parse the timestamp in seconds
Example:
`dayjs.tz(1690278073, 'X', "Europe/London").format(); // => "1970-01-20T14:31:18+01:00"`

**Expected behavior**
`dayjs.tz(1690278073, 'X', "Europe/London").format(); // => ""2023-07-25T10:41:13+01:00"`

**Information**
- Day.js Version [v1.11.9]
- OS: [Ubuntu 20.04.6]
- Browser [chrome 115.0.5790.102]
- Time zone: [GMT+03:00]

Contributor guide

Open the contributing guide

Research direction

Start with the timezone plugin and reproduce the reported call using the Day.js v1.11.9 setup. Check how the plugin handles the 'X' format and compare its output with the expected 2023 timestamp; done means the example formats correctly without regressing other timezone parsing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
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.