iamkun / iamkun/dayjs

Timezone plugin different output

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

Description

**Describe the bug**
```
dayjs.tz('2018-09-17T05:38:46.000-07:00', 'America/Los_Angeles').format('MM/DD/YYYY [at] h:mm A z')
"09/17/2018 at 12:38 PM PDT"
```
```
dayjs('2018-09-17T05:38:46.000-07:00').tz('America/Los_Angeles').format('MM/DD/YYYY [at] h:mm A z')
"09/17/2018 at 5:38 AM PDT"
```

```
moment.tz('2018-09-17T05:38:46.000-07:00', 'America/Los_Angeles').format('MM/DD/YYYY [at] h:mm A z')
"09/17/2018 at 5:38 AM PDT"
```

is this expected behavior?

**Information**
- Day.js Version 1.9.1
- OS: macOS 10.15.17
- Browser chrome 85.0.4183.121
- Time zone: GMT+3

Contributor guide

Open the contributing guide

Research direction

Start by comparing the two documented dayjs timezone calls with the Moment result and inspect the timezone plugin's parsing and conversion behavior. Confirm which output is expected for the offset-bearing input, then verify the chosen behavior against the reproduced formatting example and a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

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