Search This Blog

Wednesday, October 12, 2016

Different values with Date() in Chrome and IE

Different values with Date() in Chrome and IE

IE

Chrome



It is a bug in the ECMAScript 5.1 spec https://bugs.ecmascript.org/show_bug.cgi?id=112. From the comments on the bug, it appears that Chrome 35 implements what the spec says (literally), while IE 10 implements what the spec actually intended to say.
The bug relates to the same sentence in the spec mentioned in the question:
ECMA-262 edition 5.1 (p. 179): The value of an of absent time zone offset is "Z".
The draft version ECMAScript 6 (http://people.mozilla.org/~jorendorff/es6-draft.html) changes this sentence to:
If the time zone offset is absent, the date-time is interpreted as a local time.