HTML date format and Date.parse()

Jason Orendorff jason.orendorff at gmail.com
Thu Apr 25 13:43:26 PDT 2013


The HTML spec for parsing date and time values is slightly more lenient than ES.

The differences are:
- HTML allows more-than-4-digit years.
- HTML allows the seconds and milliseconds to be omitted.
- HTML allows the "T" in the middle to be replaced with a single space.

Can ES adopt these changes? It seems to me HTML and JS might as well
have the same rules for this sort of thing.

HTML: 2.4.5.5 Local dates and times
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#local-dates-and-times

ES: 15.9.4.2 Date.parse (string)
https://people.mozilla.com/~jorendorff/es6-draft.html#sec-15.9.4.2

ES: 15.9.1.15 Date Time String Format
https://people.mozilla.com/~jorendorff/es6-draft.html#sec-15.9.1.15

Some old discussion in Mozilla's bug-tracking system, no real conclusion:
https://bugzilla.mozilla.org/show_bug.cgi?id=791320

-j


More information about the es-discuss mailing list