Date.setUTCMilliseconds() (Method)

Set the UTC milliseconds value of the time object.

Availability:

ECMAScript edition - 2
JavaScript - 1.3
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Property/method value type:Time value
JavaScript syntax:-myDate.setUTCMilliseconds(aMillisecondValue)
Argument list:aMillisecondValuea value between 0 and 999 milliseconds

The computations are done based on extracting a UTC time value and changing the millisecond count for that before storing it back, again as a UTC time value.

The result of this method is the new time value having had the milliseconds component set according to the passed-in argument.

Example code:

   <HTML>

   <HEAD></HEAD>

   <BODY>

   <SCRIPT>

   myDate = new Date();

   myDate.setUTCMilliseconds(0);

   myTime = myDate.getTime();

   document.write("The time rounded down to the nearest second is "  + myTime + " Milliseconds");

   </SCRIPT>

   </BODY>

   </HTML>

See also:Date.getMilliseconds(), Date.getUTCMilliseconds(), Date.prototype, Date.setMilliseconds()

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.25

ECMA 262 edition 3 - section - 15.9.5.29