Bug 147098

Summary: Date.parse should not accept second values of "60"
Product: WebKit Reporter: Jordan Harband <ljharb>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, fpizlo, mark.lam, ysuzuki
Priority: P2 Keywords: ES5
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://ecma-international.org/ecma-262/6.0/#sec-date-time-string-format

Description Jordan Harband 2015-07-19 15:33:35 PDT
`Date.parse('2012-12-31T23:59:60.000Z')` should return NaN, and instead returns `Date.parse('2013-01-01T00:00:00.000Z')`
`Date.parse('2015-06-30T23:59:60.000Z')` should return NaN, and instead returns `Date.parse('2015-07-01T00:00:00.000Z')`

Note that the second example is an actual leap second, and it doesn't even work properly.

The spec requires that only seconds from 0 to 59 are supported.
Comment 1 Jordan Harband 2022-04-02 15:10:15 PDT
In latest Safari, both of these return NaN, so it must have been fixed at some point.