iamkun / iamkun/dayjs

The timezone is PST8PDT, but it comes out as invalid timezone specified.

Open
#2,240 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**
A clear and concise description of what the bug is.
i am using version 1.11.5 of dayjs.

For now, I am running a global site.
So we use the dayjs().tz().guess() function to guess which time zone the user is.

The actual location of the bug user is in China.

However, the following error comes out.
RangeError: Invalid time zone specified: PST8PDT
![1](https://user-images.githubusercontent.com/102975345/219292662-25429c81-5f47-4787-8a6a-cc3bab474c6e.jpg)

There are two strange things.
1) Timezone is marked as PST8PDT, not China (user did not use vpn separately).
2) The PST8PDT time zone is not an invalid value. If I use dayjs().tz('PST8PDT') in my computer environment, there is no error.

I don't know exactly what the cause is.

**Expected behavior**
A clear and concise description of what you expected to happen.

1) The user's time zone should come out as China.
2) There should be no invalid error.

**Information**
- Day.js Version [v1.1.15]
- OS: [window]
- Browser [chrome]
- Time zone: [GMT+08:00 Asia/Shanghai]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.