New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct output of timezone ("z") for CET/CEST #1383
Comments
This relies on the browser |
@iamkun Thanks, I can see now. |
@iamkun Maybe there is still an issues. See this code: console.log(dayjs(raceDate).locale('de').format('LT z')); // Output "13:00 GMT+2" console.log(new Intl.DateTimeFormat('de', {hour: '2-digit', minute: '2-digit', timeZoneName: 'short'}).format(new Date(Date.UTC(2021, 5, 8, 11, 0, 0)))); // Output "13:00 MESZ" |
Hard coding the locale here causes presumably unintended incorrect timezone formatting for users outside of the US. Issue described in iamkun#1383, I propose removing the en-US in favour of the browser's default, or what is specified elsewhere.
I also came across this same issue, it is caused by setting the locale of Intl.DateTimeFormat to en-US. PR #1499 addresses this. |
dupe? #1154 |
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
Expected behavior
I would expect CET or CEST. If I am using the long format instead, it works as expected:
Information
The text was updated successfully, but these errors were encountered: