Issue metadata
Sign in to add a comment
|
Date / Timezone issue: new Date from JSON notation resulting in different time/timezone parts
Reported by
maus3rvo...@gmail.com,
Jun 15 2018
|
||||||||||||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Steps to reproduce the problem:
1. Execute the following code in the console:
['1927', '1940', '1941', '2018'].forEach(year => console.log(new Date(`${year}-03-12T00:00:00.000+01:00`)));
What is the expected behavior?
The date time (meaning the time part) conversion should be the same for every year:
VM85:1 Mon Mar 12 2018 00:00:00 GMT+0100 (Midden-Europese standaardtijd)
What went wrong?
Different time interpretation (and NOT by a whole hour, but different minutes!!!)
2. resulting in different interpretations:
VM85:1 Fri Mar 11 1927 23:19:32 GMT+0019 (Midden-Europese standaardtijd)
VM85:1 Mon Mar 11 1940 23:20:00 GMT+0020 (Midden-Europese standaardtijd)
VM85:1 Wed Mar 12 1941 01:00:00 GMT+0200 (Midden-Europese standaardtijd)
VM85:1 Mon Mar 12 2018 00:00:00 GMT+0100 (Midden-Europese standaardtijd)
Did this work before? Yes Chrome 66
Chrome version: 67.0.3396.87 Channel: stable
OS Version: 10.0
Flash Version:
,
Jun 18 2018
The issue looks similar to issue id: 852321. Hence, merging into issue id: 852321. Please feel free to undupe the same if not the case. Thanks...!!
,
Jun 18 2018
Hi, things might be related, however the issue I'm having is a bit more confusing, because the timezone offset differs not by the whole (or half) hour, but I'm seeing a difference in minutes and even seconds. That can't be right. Please look at the same json format used in Chrome 65 (see attached image) and compare it with the previous attached image.
,
Jun 20 2018
Go to https://www.timeanddate.com/time/zone/netherlands/amsterdam and select 1925-1949. Amsterdam time before 1937 was 19 minutes ahead of UTC. In 1937, it changed to 20 minutes ahead of UTC.
,
Jun 20 2018
Okay, I’ve looked into this in more depth and I see that you are correct. However, when implementing this more accurate behavior, did you consider the impact this would/could have for a lot of web applications? As to my knowledge Chrome is currently the only browser that has adopted these new standards. I know that as developers we should have anticipated this and should use UTC as much as possible, in fact we are doing that for some years now. But we also have a lot of legacy code that is not prepared for this change, and even though you are implementing correct behavior, you should have provided an option to opt out for certain pages. I hope you take this in consideration. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by susan.boorgula@chromium.org
, Jun 17 2018