JavaScript setUTCMinutes() Method
Example
Set the minutes field to 17 according to UTC time:
var d = new Date();
d.setUTCMinutes(17);
d Output according to local time:
Try it »
Definition and Usage
The setUTCMinutes() method is used to set the minutes 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 setUTCMinutes() method.
Syntax
Date
.setUTCMinutes(
min
,
sec
,
millisec
)
Parameter Values
| Parameters | Description |
|---|---|
| min | Required. The value to set for the minutes field of date Object, expressed in universal time.
This parameter should be an integer between 0 and 59: |
This parameter is an integer between 0 and 59:
- -1 is the last second of the previous minute
- 60 is the first second of the next minute.
This parameter is an integer between 0 and 999:
- -1 is the last millisecond of the previous second.
- 1000 is the first millisecond of the next second.
Return Value
| Type | Description |
|---|---|
| Number | The number of milliseconds from midnight in January 1970 to the set time. |
Technical Details
| JavaScript version: | 1.3 |
|---|
More examples
Example
In this example, we will set the minutes field of the current time to 90 minutes earlier using the setUTCMinutes() method:
var d = new Date();
d.setUTCMinutes(d.getUTCMinutes()-90);
d Output according to the current time:
Try it »
JavaScript Date object