setUTCMilliseconds
Sets the UTC date's milliseconds.
UTC time is the same as GMT time.
setUTCMilliseconds() |
Yes | Yes | Yes | Yes | Yes |
dateObject.setUTCMilliseconds(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.setUTCMilliseconds(12);
console.log(myDate.toString());
The code above generates the following result.