JavaScript setUTCMilliseconds() Method
Example
Set the specified milliseconds to 192 according to Universal Time (UTC):
var d = new Date();
d.setUTCMilliseconds(192);
var n = d.getUTCMilliseconds();
n Output result:
Try it »
Definition and Usage
The setUTCMilliseconds() method is used to set the milliseconds of a specified time according to Universal Time (UTC).
**Note:** Coordinated Universal Time, also known as Universal Time, Universal Standard Time, or International Coordinated Time, abbreviated as UTC (Universal Coordinated Time).
**Note:** UTC time is the same as GMT (Greenwich) time.
Browser support





All major browsers support the setUTCMilliseconds() method.
Syntax
Date
.setUTCMilliseconds(
millisec
)
Parameter value
| Parameters | Description |
|---|---|
| millisec | Required. The value to set for the milliseconds field of dateObject. Expressed in universal time.
This parameter is an integer between 0 and 999: |
Return Value
| Type | Description |
|---|---|
| Number | Returns the number of milliseconds from midnight on January 1, 1970 to the time at which the specified milliseconds are set. |
Technical Details
| JavaScript version: | 1.3 |
|---|
JavaScript Date object