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

Jordan Harband
Reported 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.
Attachments
Jordan Harband
Comment 1 2022-04-02 15:10:15 PDT
In latest Safari, both of these return NaN, so it must have been fixed at some point.
Note You need to log in before you can comment on or make changes to this bug.