JavaScript getUTCMilliseconds()Method

Date 对象参考手册JavaScript Date Object

Example

Returns the milliseconds (0~999) of the time according to Universal Time (UTC):

var d = new Date();
var n = d.getUTCMilliseconds();

nOutput:


Try it Yourself »


Definition and Usage

The getUTCMilliseconds() method returns the milliseconds (0~999) of the time according to Universal Time (UTC).

Coordinated Universal Time (UTC) is a time measurement system based on the atomic second, which is as close as possible to Universal Time in terms of time moments.

Tip:Coordinated Universal Time, also known as Universal Time Coordinated, World Standard Time, International Coordinated Time, abbreviated as UTC (Universal Coordinated Time).

NoteUTC time is the same as GMT (Greenwich) time.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the getUTCMilliseconds() method


Syntax

Date.getUTCMilliseconds()

Return Value

Type Description
Number The value is an integer between 0 and 999.

Technical Details

JavaScript Version: 1.3


More Examples

Example

Here, we will extract the UTC milliseconds from a specific date and time:

var d = new Date("July 21, 1983 01:15:00:195");
var n = d.getUTCMilliseconds();

nOutput:


Try it Yourself »
实例s

Display the current UTC time
How to use getUTCHours(), getUTCMinutes(), and getUTCSeconds() to display the current UTC time.


Date 对象参考手册JavaScript Date Object

Other Extensions