Date.constructor

Constructor for the Date object.

Syntax

new Date()
new Date(value?)
new Date(year, month, day, hours?, minutes?, seconds?, milliseconds?)

Parameters

Return value

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.