Constructor for the Date object.
new Date()
new Date(value?)
new Date(year, month, day, hours?, minutes?, seconds?, milliseconds?)
value optional
Can be:
year optional
The year as an integer.
Since JavaScript was invented in the 20th century, when people didn’t know a lot about time keeping, when provided a year between 0 and 99, it is interpreted as a year in the 20th century.
month optional
The month as an integer between 0 (January) and 11 (December).
day optional
The day as an integer between 1 and 31.
hours optional
The hour as an integer between 0 and 23.
minutes optional
The minute as an integer between 0 and 59.
seconds optional
The second as an integer between 0 and 59.
milliseconds optional
The millisecond.
A new Date object.
The date object will be invalid if it fails to parse the date string. For invalid
dates, the Date object will return NaN for all date methods that return a number,
or “Invalid Date” string for methods that return a string.