Standard built-ins
Date.prototype.setTime()
Replace time value with supplied millisecond count after time clipping; returns new timestamp or NaN.
Formal Syntax & Structure
javascript syntaxjavascript
date.setTime(time)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| time | Number | Millisecond timestamp. |
Return Value
Number
New timestamp or NaN.
Working Example
Example Snippetjavascript
const d=new Date(0);console.log(d.setTime(5),d.getTime());