Date.parse doesn't accept leap second
Reported by utatane....@gmail.com, Feb 12 2012
Feb 12 2012,
Feb 13 2012,
Feb 22 2012,
The ECMA262 spec says "In time values leap seconds are ignored." without really saying what that implies (ignore their existence, returning NaN, or ignore their effect, returning the same time as the second that follows?). What bothers me is that fake leap seconds are also accepted in this suggestion, such as '1999-12-31T22:55:60.999'. A quick test on the current releases of Firefox and Safari shows that both also return NaN. Please understand that we do not want to introduce new behavior if not for compatibility to other browsers or official conformance tests. However, both may change in the future.
Jun 27 2015,
Any update on this topic as the next leap second will happen in just a few days time?
Jun 29 2015,
The ES6 spec hasn't changed this, so V8's behaviour still seems correct and as required. If you care about leap seconds being allowed/handled in Date, I'm afraid you need to propose a spec change to the Ecma TC39 committee. In the meantime I'm closing this bug.
Sign in to add a comment