Why Date.parse("2011-11-15") considers current time zone in Web browser, and Date.parse("2011/11/15") does not? Why the results are different?
Why Date.parse(2011-11-15) considers current time zone in Web browser, and Date.parse(2011/11/15) does not? Why
Share
The first form is being considered as an ISO date in UTC, according to section 15.9.1.15 of ECMA-262. The second form is being considered in an implementation-specific way, as per section 15.9.4.2:
So I suspect “2011/11/15” is being converted to the local midnight of November 15th, whereas “2011-11-15” is being converted to UTC midnight of November 15th.