Javascript Date setUTCMilliseconds(milliseconds)

Introduction

Javascript Date setUTCMilliseconds(milliseconds) sets the UTC date's milliseconds.

dateObj.setUTCMilliseconds(millisecondsValue)

Parameters

  • millisecondsValue - A number between 0 and 999, representing the milliseconds.

Return value

The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date.

If a parameter is outside of the expected range, setUTCMilliseconds() updates the date accordingly.

var d = new Date();
console.log(d);//from   w w  w .  ja  va  2s.  co m
d.setUTCMilliseconds(500);
console.log(d);



PreviousNext

Related