The reason why you are seeing this is actually described on the Date.parse()
page of MDN (where a lot of the details around officially-supported Date
parameter formats are described). Specifically:
Differences in assumed time zone
Given a date string of "March 7, 2014", parse() assumes a local time zone, but given an ISO format such as "2014-03-07" it will assume a time zone of UTC (ES5 and ECMAScript 2015). Therefore Date objects produced using those strings may represent different moments in time depending on the version of ECMAScript supported unless the system is set with a local time zone of UTC. This means that two date strings that appear equivalent may result in two different values depending on the format of the string that is being converted.
So what you're seeing is a combination of two things:
- The constructor is reading your properly-formatted ISO date value as UTC, since no time zone is provided, and
- It is accurately identifying that your local computer timezone is U.S. Eastern, and adjusting the value appropriately.
As a result, you are seeing the U.S. Eastern Time zone version of midnight on January 1st, 2000, UTC time (or, 7 PM on December 31st, 1999).
Since your first example is using a non-standard format (from JS's point-of-view), the first assumption is not coming into play and the value is being created assuming the local timezone for the value (a browser-specific decision on how to handle a non-standard format).