setMilliseconds
Sets the date's milliseconds.
setMilliseconds() |
Yes | Yes | Yes | Yes | Yes |
dateObject.setMilliseconds(millisec);
Parameter | Description |
---|---|
millisec | Required. An integer representing the milliseconds. Expected values are 0-999, but other values are allowed: -1 will be the last millisecond of the previous second. 1000 will be the first millisecond of the next second |
return a number, representing the number of milliseconds between the date object and midnight January 1 1970.
var myDate = new Date();
myDate.setMilliseconds(123);
console.log(myDate.toString());
The code above generates the following result.