This table documents interesting Date.parse
test cases, classifies them by conformance (✔) vs. nonconformance (✘) with each of ISO 8601, RFC 3339, and the ECMAScript Date Time String [interchange] Format (including relevant text on hover and direct links where available), and displays the results of attempting to parse a representative example with the host implementation.
None of these cases conform to a strict interpretation of the ECMAScript Date Time String Format, and therefore each falls into the implementation-specific behavior of Date.parse
. An implementation could (and in many cases should) reject them while still remaining compliant with ECMA-262.
Input | ISO 8601 | RFC 3339 | ECMAScript | Date.parse |
---|---|---|---|---|
Positive leap second | ||||
1972-06-30T23:59:60Z | ||||
Too few fractional second digits | ||||
2019-03-26T14:00:00.9Z | ||||
Too many fractional second digits | ||||
2019-03-26T14:00:00.4999Z | ||||
Too many fractional second digits (pre-epoch) | ||||
1969-03-26T14:00:00.4999Z | ||||
Too many fractional second digits (BCE) | ||||
-000043-03-15T14:00:00.4999Z | ||||
Lowercase time designator | ||||
2019-03-26t14:00Z | (↓) | |||
Lowercase UTC designator | ||||
2019-03-26T14:00z | (↓) | |||
Comma as decimal sign | ||||
2019-03-26T14:00:00,999Z | ||||
Hours-only offset | ||||
2019-03-26T10:00-04 | ||||
Fractional minutes | ||||
2019-03-26T14:00.9Z | ||||
ISO basic format date and time | ||||
20190326T1400Z | (↓) | |||
Out-of-bounds day of month | ||||
2019-02-30 | ||||
Time past end of day | ||||
2019-03-25T24:01Z | ||||
UTC offset too large | ||||
2019-03-26T14:00+24:00 | ||||
Unused leap second opportunity | ||||
2018-06-30T23:59:60Z | ||||
Bogus leap second (not at end of month) | ||||
2019-03-26T23:59:60Z | ||||
Really bogus leap second (not even at end of UTC day) | ||||
2019-03-26T13:59:60Z | ||||
Zero UTC offset without time elements | ||||
2019-03-26Z | ||||
Positive UTC offset without time elements | ||||
2019-03-26+01:00 | ||||
Negative UTC offset without time elements | ||||
2019-03-26-04:00 | ||||
ISO basic format UTC offset | ||||
2019-03-26T10:00-0400 | ||||
Too many expanded year digits | ||||
+0002019-03-26T14:00Z | ||||
Too few expanded year digits | ||||
+2019-03-26T14:00Z | ||||
Too many unsigned year digits | ||||
002019-03-26T14:00Z | ||||
Too few unsigned year digits | ||||
019-03-26T14:00Z | ||||
Non-Z “military” designation letter offset | ||||
2019-03-26T10:00Q | ||||
Hazardous non-Z “military” designation letter offset | ||||
2019-03-26T10:00T | ||||
Non-Z “military” designation letter offset without time elements | ||||
2019-03-26Q | ||||
Hazardous non-Z “military” designation letter offset without time elements | ||||
2019-03-26T | ||||
Space as time designator | ||||
2019-03-26 14:00Z | ||||
No digits after decimal sign | ||||
2019-03-26T14:00:00. |