JavaScript setUTCMinutes()Method
Examples
Set the minutes field to 17 according to UTC time:
var d = new Date();
d.setUTCMinutes(17);
d.setUTCMinutes(17);
dOutput according to local time:
Try it Yourself »
Definition and Usage
The setUTCMinutes() method is used to set the minutes of a specified time according to Universal Time (UTC).
Tip:Coordinated Universal Time, also known as World Unified Time, World Standard Time, International Coordinated Time, abbreviated as UTC (Universal Coordinated Time).
Note:UTC time is GMT (Greenwich) time.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the setUTCMinutes() method
Syntax
Date.setUTCMinutes(min,sec,millisec)
Parameter Values
| Parameter | Description |
|---|---|
| min | Required. The value of the minutes field to set for the date Object, expressed in UTC. This parameter should be an integer between 0 and 59:
|
| sec | Optional. The value of the seconds field to set for dateObject. Expressed in UTC. This parameter is an integer between 0 and 59:
|
| millisec | Optional. The value of the milliseconds field to set for the date Object. Expressed in UTC. This parameter is an integer between 0 and 999:
|
Return Value
| Type | Description |
|---|---|
| Number | The number of milliseconds from midnight January 1, 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 ago via the setUTCMinutes() method:
var d = new Date();
d.setUTCMinutes(d.getUTCMinutes()-90);
d.setUTCMinutes(d.getUTCMinutes()-90);
dOutput according to current time:
Try it Yourself »
Other Extensions
JavaScript Date Object