Back

dateObj.getUTCMilliseconds()

dateObj.getUTCMilliseconds()

The getUTCMilliseconds() method returns the milliseconds in the specified date according to universal time.

Syntax

dateObj.getUTCMilliseconds()

Parameters

None.

Return value

The value returned by getUTCMilliseconds() is an integer between 0 and 999.

Examples

Using getUTCMilliseconds()

The following example assigns the milliseconds portion of the current time to the variable milliseconds.

var today = new Date();
var milliseconds = today.getUTCMilliseconds();

  Created by Mozilla Contributors, license: CC-BY-SA 2.5