Status: New
Owner: ----

New issue 3413 by [email protected]: new Date('YYYY-MM-DD') in ISO format parses inconsistently compared to non-ISO formats
http://code.google.com/p/v8/issues/detail?id=3413

Probably not a bug, but hopefully others might learn to avoid the gotcha
The tests below were run on a system in the GMT-5 time zone.
If your code parses and stringifies dates, watch out.

Chrome v35.0.1916.153  and node v0.10.28 >

[
new Date(  '1/1/2014'     ),
new Date(  '01/01/2014'   ),
new Date(  '2014/1/1'     ),
new Date(  '2014/01/01'   ),
new Date(  '1-1-2014'     ),
new Date(  '01-01-2014'   ),
new Date(  '2014-1-1'     ),
new Date(  '2014-01-01'   )
].join('\n')

returns

Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Tue Dec 31 2013 19:00:00 GMT-0500 (EST)

===
Recent versions of Firefox and Safari return

Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Wed Jan 01 2014 00:00:00 GMT-0500 (EST)
Invalid Date
Invalid Date
Invalid Date
Tue Dec 31 2013 19:00:00 GMT-0500 (EST)

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to