Your third example is the only one that is actually explained by the specification. When you call the Date constructor with one argument, this is what happens (where v is the string passed to the constructor):
Parse v as a date, exactly the same as for the parse method (15.9.4.2); let v be the time value for this date.
The parse method will try to parse string (highlighted by me):
A string can be interpreted as local time, UTC, or time in some other time zone, depending on the contents of the string . First, the function tries to analyze the format of the string in accordance with the rules written in the format of the time string in time (15.9.1.15).
If the string does not match this format, the function can return to any heuristic specific to a particular implementation, or to date formats of a specific version .
And the format of the date string in time is " YYYY-MM-DDTHH:mm:ss.sssZ , and also defines a shorter version of the form YYYY-MM-DD , which is what you use in your third example.
In other examples, parsing is not performed, and the behavior is determined by the implementation.
source share