Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

getUTCMilliseconds Method (JavaScript)

Returns the milliseconds value in a Date object using Universal Coordinated Time (UTC).

dateObj.getUTCMilliseconds() 

The required dateObj reference is a Date object.

To get the number of milliseconds in local time, use the getMilliseconds method.

The millisecond value returned can range from 0-999.

The following example illustrates the use of the getUTCMilliseconds method.

function UTCTimeDemo(){
   var d, s = "Current Universal Coordinated Time (UTC) is: ";
   var c = ":";
   d = new Date();
   s += d.getUTCHours() + c;
   s += d.getUTCMinutes() + c;
   s += d.getUTCSeconds() + c;
   s += d.getUTCMilliseconds();
   return(s);
}

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Applies To: Date Object (JavaScript)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.