New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2015
Cc:
Components:
HW: All
NextAction: ----
OS: All
Priority: 2
Type: Bug



Sign in to add a comment

new Date uses the wrong timezone

Project Member Reported by arv@chromium.org, Jun 25 2015

Issue description

We 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()
 
Cc: rossberg@chromium.org
Owner: u...@chromium.org
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?

Comment 3 by u...@chromium.org, Jul 20 2015

thanks hichris123@.

Andreas, wdyt? Should we break es5 to fix es6?
What do other browsers do?
Firefox defaults to the local timezone (ES6 style). Supposedly IE does too. Not sure about Edge or Safari.
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.
It seems like Safari still follows the ES5 style parsing (defaulting to UTC).
What do you think, should we update the behavior?
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.

Comment 10 by u...@chromium.org, 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.
Project Member

Comment 11 by bugdroid1@chromium.org, 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

Status: Fixed
Okay, hopefully fixed.
Project Member

Comment 13 by bugdroid1@chromium.org, 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

Labels: Priority-2

Sign in to add a comment