iamkun / iamkun/dayjs

Correct output of timezone ("z") for CET/CEST

Open
#1,383 5 comments 2 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**
When I am formatting the timzone with "z", I'll get a GMT+2. The date I am using is 2022-05-22, 11:00am UTC

```
dayjs(raceDate).locale(locale).format('LT z') // Output "13:00 GMT+2"
```

**Expected behavior**
I would expect CET or CEST. If I am using the long format instead, it works as expected:

```
dayjs(raceDate).locale(locale).format('LT zzz') // Output "13:00 Central European Summer Time"
```

**Information**
- Day.js Version: 1.9.7
- OS: iOS
- Browser: Safari
- Time zone: GMT+02:00 CEST

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the format('LT z') and format('LT zzz') examples with the supplied 2022-05-22 UTC date, then trace the timezone-formatting entry point. Done means the short format returns CET or CEST for the reported date and locale, while the long format continues to return Central European Summer Time.

Written by the indexing model from the issue text.

Assessment

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