new Date has wrong UTC timezone offset for Europe/London in 1969, 1970, 1971
Reported by
fab.ped...@gmail.com,
Mar 3 2016
|
|||||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36
Steps to reproduce the problem:
1. Run Chromium in the UK timezone, for instance with:
$ TZ=Europe/London chromium &
2. In the F12 JavaScript console enter each of these in turn:
new Date(1971, 0, 1).toISOString()
new Date(1971, 6, 1).toISOString()
new Date(1972, 0, 1).toISOString()
new Date(1972, 6, 1).toISOString()
What is the expected behavior?
Both the 1971 dates should be in UTC+1 (‘British Summer Time’), so in UTC should show as 23:00 the previous day:
"1970-12-31T23:00:00.000Z"
"1971-06-30T23:00:00.000Z"
1972-01 should be in UTC, and 1972-07 in UTC+1:
"1972-01-01T00:00:00.000Z"
"1972-06-30T23:00:00.000Z"
What went wrong?
The dates in 1971 are treated as though they were in UTC, not UTC+1:
"1971-01-01T00:00:00.000Z"
"1971-07-01T00:00:00.000Z"
The 1972 dates are correct:
"1972-01-01T00:00:00.000Z"
"1972-06-30T23:00:00.000Z"
Most years Europe/London is in UTC during the winter and UTC+1 during the summer. However, for the 3 winters of 1968–71 it remained in ‘daylight saving’ UTC+1 throughout the winter, and stayed in that timezone during the summer.
So the 1971 dates should be ‘23:00 the previous day’ in UTC, just like the 1972-07 date is.
That the two 1971 dates use the same UTC offset as each other suggests that you are treating that year specially, but the wrong way round: you have it as winter throughout the year rather than summer all year.
Did this work before? N/A
Chrome version: 48.0.2564.116 Channel: n/a
OS Version:
Flash Version: Shockwave Flash 14.0 r0
See this Firefox bug for the background and why this matters:
https://bugzilla.mozilla.org/show_bug.cgi?id=994019#c33
Firefox gets the UTC offsets right. Unfortunately that breaks axis labels in Google Books Ngram Viewer, which itself has a bug. The Ngram Viewer bug doesn't occur in Chromium because of this bug.
I reported the Ngram Viewer bug as Google Books feedback (I couldn't find Ngram Viewer-specific contact details), so hopefully they will change their code not to rely on this Chromium bug.
,
Mar 3 2016
,
Mar 4 2016
,
Mar 6 2017
This issue has been available for more than 365 days, and should be re-evaluated. Please re-triage this issue. The Hotlist-Recharge-Cold label is applied for tracking purposes, and should not be removed after re-triaging the issue. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 5 2017
,
Apr 16 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 16 2018
Confirmed that the bug still exists, exactly as described above, in Chromium 64. (I can't see anywhere to change the status, so I'm presuming I don't have the privs to do so.)
,
Apr 24 2018
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by fab.ped...@gmail.com
, Mar 3 2016