|value||The number of milliseconds since 1 January 1970 00:00:00.000 UTC (Unix epoch)|
|dateAsString||A date formatted as a string (see examples for more information)|
|year||The year value of the date. Note that month must also be provided, or the value will be interpreted as a number of milliseconds. Also note that values between 0 and 99 have special meaning. See the examples.|
|month||The month, in the range 0-11. Note that using values outside the specified range for this and the following parameters will not result in an error, but rather cause the resulting date to "roll over" to the next value. See the examples.|
|day||The date, in the range 1-31.|
|hour||The hour, in the range 0-23.|
|minute||The minute, in the range 0-59|
|second||The second, in the range 0-59.|
|millisecond||The millisecond, in the range 0-999.|
Create a new Date object
To create a new Date object use the Date() constructor:
Date() creates a Date instance containing the current time (up to milliseconds) and date.
Date(m) creates a Date instance containing the time and date corresponding to the Epoch time (1 January, 1970 UTC) plus m milliseconds. Example: new Date(749019369738) gives the date Sun, 26 Sep 1993 04:56:09 GMT.
Date(dateString) returns the Date object that results after parsing dateString with Date.parse.
Note that these examples were generated on a browser in the Central Time Zone of the US, during Daylight Time, as evidenced by the code. Where comparison with UTC was instructive, Date.prototype.toISOString() was used to show the date and time in UTC (the Z in the
formatted string denotes UTC).
Creates a Date object with the current date and time from the user's browser