English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The setTime() method sets the time of the date object by specifying from 1970-1-1 00:00:00 UTC start time in milliseconds to set the time of the date object, for dates earlier than 1970-1-1 00:00:00 UTC time can be represented by negative values.
date.setTime(millisec)
var d = new Date(); d.setTime(1542655292087);Test See‹/›
All browsers fully support the setTime() method:
Method | |||||
setTime() | Is | Is | Is | Is | Is |
Parameter | Description |
---|---|
millisec | An integer representing the number of1970 Year1Month1Milliseconds since 00:00:00 UTC |
Return Value: | 1970 Year1Month1Milliseconds between 00:00:00 UTC and the update date |
---|---|
JavaScript Version: | ECMAScript 1 |