setTime() method sets the
to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
- An integer representing the number of milliseconds since 1 January 1970, 00:00:00 UTC.
The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date (effectively, the value of the argument).
setTime() method to help assign a date and time to another
var theBigDay = new Date('July 1, 1999'); var sameAsBigDay = new Date(); sameAsBigDay.setTime(theBigDay.getTime());
The definition of 'Date.prototype.setTime' in that specification.
BCD tables only load in the browser