Note: This section contains implementation-specific behavior that can be inconsistent across implementations.
Implementations usually default to the local time zone when the date string is non-standard. For consistency, we will assume that the code uses the UTC timezone.
Date.parse("Jan 1, 1970"); // 0 in all implementations
Date.parse("Thu, 01 Jan 1970 00:00:00"); // 0 in all implementations
Date.parse("1970,1,1"); // 0 in Chrome and Firefox, NaN in Safari
Date.parse("02 01 1970");
// 2678400000 in Chrome and Firefox (Sun Feb 01 1970 00:00:00 GMT+0000);
// NaN in Safari
// With explicit timezone
Date.parse("Thu, 01 Jan 1970 00:00:00 GMT+0300");
// -10800000 in all implementations in all timezones
// Single number
Date.parse("0");
// NaN in Firefox ≤122
// 946684800000 in Chrome and Firefox ≥123 (Sat Jan 01 2000 00:00:00 GMT+0000);
// -62167219200000 in Safari (Sat Jan 01 0000 00:00:00 GMT+0000)
// Two-digit number that may be a month
Date.parse("28");
// NaN Chrome and Firefox
// -61283606400000 in Safari (Fri Dec 31 0027 23:58:45 GMT-0001)
// Two-digit year
Date.parse("70/01/01"); // 0 in all implementations
// Out-of-bounds date components
Date.parse("2014-25-23"); // NaN in all implementations
Date.parse("Mar 32, 2014"); // NaN in all implementations
Date.parse("2014/25/23"); // NaN in all implementations
Date.parse("2014-02-30");
// NaN in Safari
// 1393718400000 in Chrome and Firefox (Sun Mar 02 2014 00:00:00 GMT+0000)
Date.parse("02/30/2014"); // 1393718400000 in all implementations
// Chrome, Safari, and Firefox 122 and later parse only the first three letters for the month.
// FF121 and earlier parse first three letters and any substring up to the correct month name.
Date.parse("04 Dec 1995"); // 818031600000 in all implementations
Date.parse("04 Decem 1995"); // 818031600000 in all implementations
Date.parse("04 December 1995"); // 818031600000 in all implementations
Date.parse("04 DecFoo 1995"); // NaN in Firefox 121 and earlier. 818031600000 in other implementations
Date.parse("04 De 1995"); // NaN in all implementations