JavaScript tutorial:
getUTCMilliseconds method

 

Applies to: Date Object

The getUTCMilliseconds method is use to get the milliseconds value in a Date object using Universal Coordinated Time (UTC).

Syntax

objDate.getUTCMilliseconds()

Return

Returns the milliseconds value in a Date object using UTC.

Example

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:

s = "Current Universal Coordinated Time (UTC) is: "; = ":";
d = new Date();
s += d.getUTCHours() + c;
s += d.getUTCMinutes() + c;
s += d.getUTCSeconds() + c;
s += d.getUTCMilliseconds();

document.write(s);

  To run the code above, paste it into JavaScript Editor, and click the Execute button

See Also: Date Object Methods, getMilliseconds Method, setMilliseconds Method, setUTCMilliseconds Method