Date.getUTCMilliseconds() (Method)

Return the UTC milliseconds for a date/time.

Availability:

ECMAScript edition - 2
JavaScript - 1.3
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Property/method value type:Number primitive
JavaScript syntax:-myDate.getUTCMilliseconds()

The result of this method is the milliseconds of the time value contained in the receiving object. The value will be in the range 0 to 999 inclusive.

The value is computed according to UTC time co-ordinates.

Example code:

   <HTML>

   <HEAD></HEAD>

   <BODY>

   <DIV ID="RESULT">000</DIV>

   <SCRIPT>

   // Check the accuracy of a timer by printing the milliseconds

   setInterval("monitor()", 1000);

   myOldMSecs = 000;

   function monitor()

   {

   myDate  = new Date();

   myMsecs = myDate.getUTCMilliseconds();

   myErr = myMsecs - myOldMSecs;

   document.all.RESULT.innerText = myMsecs + " (" + myErr + " milliseconds of error)";

   myOldMSecs = myMsecs;

   }

   </SCRIPT>

   </BODY>

   </HTML>

See also:Date.prototype, Date.setUTCMilliseconds(), Event.timeStamp

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.21

ECMA 262 edition 3 - section - 15.9.5.25