When calling the Date constructor it is possible to supply one or more arguments to the constructor that can be used to set the point in time in which the date object represents. When supplying two or more arguments like in the example above the first argument is a full year, and the second argument is a zero relative month of that year, followed by the day of the month and so forth. However there are many other options as well to set a date, more on that later.
When creating a Date object with a single argument if the single argument is a number that argument is treated as a number of milliseconds that has passed sense the first of January 1970, as the nature of unix time is based off that date in time. This is useful for creating new date objects from a number value that is the result of operations that resolve to such a value which can come up from time to time. The value must be a number data type though rather than a string, as that will be recognized as a year.
When setting a value of zero the values that are received when using a Date prototype method such as todateString might not end up being what is expected. This is because of time zones, for example I am dealing with Eastern Standard Time where I live so there is a three hundred minute offset. So there is the get time method, but then there is also the get time zone offset method as well that can be use as a way to adjust for these inconstancies.
It is not a good idea to just pass a string as the first argument and expect it to work on all platforms. There are many different formats both standard and not so standard, and not a platforms will support all formats. So in some cases it will work as expected on one platform, but not on another.
So it is generally a good idea to parse a date string manually and feed the date constructor a number as the first argument or use two or more arguments.
When setting from two or more arguments the first argument is the full year followed by the zero relative month of the year and then so on all the way to milliseconds.