My favorites | Sign in
Logo
             
New issue | Search
for
| Advanced search | Search tips
Issue 41754: Date.parse can't parse Date.toJSON() output
5 people starred this issue and may be notified of changes. Back to list
 
Reported by phofstetter, Apr 16, 2010
Chrome Version       : 5.0.378.0 (Developer Build 44471)

Chromium	5.0.378.0 (Developer Build 44471)
WebKit	533.5
V8	2.2.2
User Agent	Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/533.5 
(KHTML, like Gecko) Chrome/5.0.378.0 Safari/533.5
Command Line	 /Applications/Chromium.app/Contents/MacOS/Chromium -psn_0_48893598

URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: OK
  Firefox 3.x: OK

What steps will reproduce the problem?
1. console.log(Date.parse((new Date()).toJSON()));

What is the expected result?

The console should show some representation of the current date

What happens instead?

The console shows NaN

Please provide any additional information below. Attach a screenshot if
possible.

I noticed that lately, Date.toJSON began to emit a timestamp in ISO form with microseconds while 
Date.parse() is unable to handle the ISO format (it should though according to the ES5 
documentation)
Comment 1 by phofstetter, Apr 16, 2010
I just noticed that it fails in Safari 4 too. Firefox is correct, though Date.toJSON() doesn't contain any time 
information there.
Comment 2 by m...@tinco.nl, Apr 23, 2010
Hi, I have the same issue, easy reproduction:

> new Date("2010-04-23T10:05:00+00:00")
Invalid Date

In the javascript console :)
Comment 3 by bauerb@chromium.org, Apr 23, 2010
(No comment was entered for this change.)
Status: Untriaged
Labels: Area-WebKit WebKit-JavaScript
Comment 4 by karen@chromium.org, Apr 28, 2010
(No comment was entered for this change.)
Owner: sandh...@chromium.org
Labels: Mstone-X
Comment 5 by sandh...@chromium.org, Apr 28, 2010
Rico, could you have a look at this?
Status: Assigned
Owner: ri...@chromium.org
Cc: a...@chromium.org sandh...@chromium.org
Comment 6 by ri...@chromium.org, May 03, 2010
This was fixed in v8 bleeding_edge in revision 4547. The reason for this bug was that 
Date.parse did not have support for the ECMAScript 5 syntax for dates (i.e., T before 
the time and additionally Z for UTC).
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting