new Date uses the wrong timezone |
|||
Issue descriptionWe are failing the following test https://github.com/tc39/test262/blob/master/test/built-ins/Date/15.9.1.15-1.js It looks like we are using the local time zone when we do: new Date(1970, 0, 1, 0, 0, 0, 0).toISOString()
,
Jul 20 2015
I have a CL ready to fix this: https://codereview.chromium.org/1229903004/. However, as I mentioned in https://crbug.com/391730 , this has the potential to break a lot of applications, so how should we go about doing this?
,
Jul 20 2015
thanks hichris123@. Andreas, wdyt? Should we break es5 to fix es6?
,
Jul 20 2015
What do other browsers do?
,
Jul 20 2015
Firefox defaults to the local timezone (ES6 style). Supposedly IE does too. Not sure about Edge or Safari.
,
Jul 21 2015
We should find out what Safari does, because that is the only other browser currently relevant in mobile space. If that follows ES6 already then we should be safe.
,
Jul 21 2015
It seems like Safari still follows the ES5 style parsing (defaulting to UTC).
,
Jul 24 2015
What do you think, should we update the behavior?
,
Jul 24 2015
I'd feel better if Safari already implemented it, but I'm fine with trying, if Ulan has the time. Historically, changes like that have caused pain, so we should be prepared.
,
Jul 24 2015
Since this is specified in ES6, we will have to change parsing sooner or later. I am fine with changing it now.
,
Jul 24 2015
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/f06754a8e1d305a43560705f6c167d85d40e602d commit f06754a8e1d305a43560705f6c167d85d40e602d Author: hichris123 <hichris123@gmail.com> Date: Fri Jul 24 17:19:33 2015 Make dates default to the local timezone if none specified In ES5, dates were supposed to default to UTC if no timezone was specified. However, this changed in ES6, which specified that dates should be in the local timezone if no timezone was specified. This CL updates our behavior to match that part of the ES6 spec. BUG= chromium:391730 , v8:4242 LOG=Y Review URL: https://codereview.chromium.org/1229903004 Cr-Commit-Position: refs/heads/master@{#29854} [modify] http://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d/src/dateparser-inl.h [modify] http://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d/src/dateparser.h [modify] http://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d/test/mjsunit/date-parse.js [modify] http://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d/test/mjsunit/date.js [modify] http://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d/test/test262-es6/test262-es6.status [modify] http://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d/test/test262/test262.status
,
Jul 24 2015
Okay, hopefully fixed.
,
Oct 15 2015
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/dd3f1ecf719afd21b4c695c776b4da2fb494ef92 commit dd3f1ecf719afd21b4c695c776b4da2fb494ef92 Author: ulan <ulan@chromium.org> Date: Thu Oct 15 12:17:56 2015 Revert of Make dates default to the local timezone if none specified (https://codereview.chromium.org/1229903004/) Even though the change is ES6 spec compliant, we decided to revert to be consistent with other browsers and work on fixing the spec. Original issue's description: > Make dates default to the local timezone if none specified > > In ES5, dates were supposed to default to UTC if no timezone was specified. However, this changed in ES6, which specified that dates should be in the local timezone if no timezone was specified. This CL updates our behavior to match that part of the ES6 spec. > BUG= chromium:391730 , v8:4242 > LOG=Y > Committed: https://crrev.com/f06754a8e1d305a43560705f6c167d85d40e602d > Cr-Commit-Position: refs/heads/master@{#29854} BUG= chromium:543320 , chromium:539813 LOG=NO Review URL: https://codereview.chromium.org/1403153003 Cr-Commit-Position: refs/heads/master@{#31295} [modify] http://crrev.com/dd3f1ecf719afd21b4c695c776b4da2fb494ef92/src/dateparser-inl.h [modify] http://crrev.com/dd3f1ecf719afd21b4c695c776b4da2fb494ef92/src/dateparser.h [modify] http://crrev.com/dd3f1ecf719afd21b4c695c776b4da2fb494ef92/test/mjsunit/date-parse.js [modify] http://crrev.com/dd3f1ecf719afd21b4c695c776b4da2fb494ef92/test/mjsunit/date.js [modify] http://crrev.com/dd3f1ecf719afd21b4c695c776b4da2fb494ef92/test/test262/test262.status
,
Mar 23 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by rossberg@chromium.org
, Jun 29 2015Owner: u...@chromium.org