Leap seconds for Date.parse

Peter van der Zee ecma at qfox.nl
Mon Jul 19 09:00:21 PDT 2010


While 15.9.1.1 explicitly says leap seconds are ignored by ECMAscript, the ISO 
8601 timestamp format allows them. 

15.9.1.15 (used by Date.parse) does dictate ranges for months and dates (days of 
month), but they don't specify the range for hours, minutes and (milli)seconds 
(although a note says 00 is the same as 24, fine). On the other hand, "the 
number of x passed since y" can be interpreted as a range. But does this 
interpretation come through the viewport of ECMAscript (ignoring leap seconds) 
or the real world.

The last paragraph in 15.9.1.15 before the notes says to reject all dates it 
cannot parse.

Now my question is, should "T23:59:60" be a valid timestamp as parsed by 
Date.parse?

Which basically comes down to the question whether Date.parse should only parse 
dates Ecmascript can produce itself or dates ISO 8601 could produce. If up in 
the air, my vote goes to allow leap second notation. The current Firefox 
implementation (for example) seems to reject it.

- peter


More information about the es-discuss mailing list