Comment #3 on issue 4265 by [email protected]: Inconsistent behavior in date parse
https://code.google.com/p/v8/issues/detail?id=4265

Apparently "2016-01-01" is parsed as a UTC string, and "2016-1-1" as a local time string:

(new Date(Date.parse("2016-1-1"))).toString()
"Fri Jan 01 2016 00:00:00 GMT+0100 (CET)"
(new Date(Date.parse("2016-01-01"))).toString()
"Fri Jan 01 2016 01:00:00 GMT+0100 (CET)"

So if you are in the EST zone (or any zone west of Greenwich, really), you'll see new Date("2016-01-01") => Dec 31, 2015.

Btw, using === is fine here, as Date.parse returns a number:

Date.parse("2016-01-01") === Date.parse("2016-01-01")
true

--
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