-
Notifications
You must be signed in to change notification settings - Fork 156
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
introduce proper LocalTZA(t,isUTC) #239
Comments
@drsm See 989d85c#diff-dbf994c61cc8c6d79786ce6801aad8a5R184 why |
Actually, looks like a bug in test262, > var args = [2014, 0]
undefined
> var d = new Date(...args); d.valueOf() - d.getTimezoneOffset() * 60000 - Date.UTC(...args);
0
> var args = [-2014, 0]
undefined
> var d = new Date(...args); d.valueOf() - d.getTimezoneOffset() * 60000 - Date.UTC(...args);
-17000
> d.toString()
'Wed Jan 01 -2014 00:00:00 GMT+0230 (Moscow Standard Time)'
> but, there is still no consensus about this: root@node:~# TZ='Europe/Moscow' eshost -x 'var d = new Date(-2014, 0); print(d.valueOf() - d.getTimezoneOffset() * 60000 - Date.UTC(-2014, 0))'
#### ch
0
#### jsc
0
#### sm
0
#### v8
-17000
#### xs
0 |
I guess, usually there is not such strange timezones as in
|
The fix introduced a "weird seconds problem". But it's still not covered by test262. I'm OK with the current implementation, as the proper one, which works well in every corner case, will require an ICU stuff as a dependency.
looks like it didn't understand $ TZ=MSK node -e 'console.log((new Date()).toString())'
Fri Nov 08 2019 20:51:03 GMT+0000 (GMT)
$ TZ=Europe/Moscow node -e 'console.log((new Date()).toString())'
Fri Nov 08 2019 23:51:15 GMT+0300 (Moscow Standard Time) |
OK, I think we simply can wait until test262 is updated. |
the spec
full story
v8
Here is the patch:
The text was updated successfully, but these errors were encountered: