JavaScript Date


  • new Date();
  • new Date(value);
  • new Date(dateAsString);
  • new Date(year, month[, day[, hour[, minute[, second[, millisecond]]]]]);


valueThe number of milliseconds since 1 January 1970 00:00:00.000 UTC (Unix epoch)
dateAsStringA date formatted as a string (see examples for more information)
yearThe 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.
monthThe 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.
dayOptional: The date, in the range 1-31.
hourOptional: The hour, in the range 0-23.
minuteOptional: The minute, in the range 0-59.
secondOptional: The second, in the range 0-59.
millisecondOptional: The millisecond, in the range 0-999.