Date.parse ignores system timezone when parsing ISO8601 without time zone designator
Reported by
jozefchu...@gmail.com,
Feb 28 2017
|
|||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Steps to reproduce the problem:
1. have your system timezone offset something other then 0. i.e. use CET
2. check new Date().getTimezoneOffset() correctly returns -60
3. see Date.parse("1970-01-01T00:00:00") returns 0
What is the expected behavior?
Date.parse("1970-01-01T00:00:00") should return -3600000 while it returns 0
What went wrong?
According to ISO 8601 https://en.wikipedia.org/wiki/ISO_8601 "If no UTC relation information is given with a time representation, the time is assumed to be in local time."
With the correct parser implementation, I would expect the datetime string should be interpreted as local time and so the output timestamp to be -3600000.
IE11, Edge and FireFox seems to return expected -3600000.
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 56.0.2924.87 Channel: stable
OS Version: 10.0
Flash Version:
,
Mar 2 2017
The behavior before the patch is long-standing Chrome behavior, based on a previous specification. The new behavior has unknown compatibility risks--sites which are targeted towards Chrome may depend on the old behavior. Even though the patch would be easy to backport, I'd prefer to let it roll out gradually through the canary/dev/beta release train to discover compatibility issues. I cc'd some more people who have been involved in V8 Date issues and backports; I'd be interested if anyone has any more thoughts.
,
Mar 2 2017
Given that the "bad" behavior is long-standing Chrome behavior, I don't think we want to backport this. Also, I don't think I'd say this is a "regression". Marking as "WontFix", as in, "already fixed in most recent version". |
|||
►
Sign in to add a comment |
|||
Comment 1 by krajshree@chromium.org
, Mar 2 2017Labels: -Type-Bug -Pri-2 M-58 OS-Linux OS-Mac Pri-1 Type-Bug-Regression
Owner: littledan@chromium.org
Status: Assigned (was: Unconfirmed)