Skip to content
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

new Date().toString() returns shortened timezone #466

Open
zedd3v opened this issue Jan 4, 2023 · 2 comments
Open

new Date().toString() returns shortened timezone #466

zedd3v opened this issue Jan 4, 2023 · 2 comments

Comments

@zedd3v
Copy link

zedd3v commented Jan 4, 2023

new Date().toString()

returns: Thu Jan 05 2023 00:16:15 GMT+0100 (CET)
expected Thu Jan 05 2023 00:16:15 GMT+0100 (Central European Standard Time)

@dop251
Copy link
Owner

dop251 commented Jan 5, 2023

The specification leaves the time zone implementation-defined (see https://tc39.es/ecma262/#sec-timezoneestring).

Having said that I wouldn't mind bringing it in line with v8 and Spider Monkey if it was an easy fix. Unfortunately it doesn't look this way: the full localized time zone name is not available from the standard Go library and I could not find any 3rd party library either. If I missed something I'd welcome a PR.

@zedd3v
Copy link
Author

zedd3v commented Jan 5, 2023

I found that V8 uses https://github.com/unicode-org/icu

https://github.com/unicode-org/icu/blob/main/icu4c/source/data/zone/en.txt

It doesn't look like an easy fix but it would be possible to reuse some of their logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants