Easy Tutorial
❮ Prop Input Time Form Jsref Substr ❯

JavaScript setUTCMinutes() Method

JavaScript Date Object

Example

Set the minutes field to 17 according to UTC time:

d output in local time:


Definition and Usage

The setUTCMinutes() method is used to set the minutes of a specified time according to Coordinated Universal Time (UTC).

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

Note: UTC time is the same as GMT (Greenwich Mean Time).


Browser Support

All major browsers support the setUTCMinutes() method.


Syntax

Parameter Values

Parameter Description
min Required. The value of the minutes field to be set for the date Object, expressed in UTC. This parameter should be an integer between 0 and 59: -1 is the last second of the previous minute<br>60 is the first second of the next minute
sec Optional. The value of the seconds field to be set for the dateObject, expressed in UTC. This parameter should be an integer between 0 and 59: -1 is the last second of the previous minute<br>60 is the first second of the next minute
millisec Optional. The value of the milliseconds field to be set for the date Object, expressed in UTC. This parameter should be an integer between 0 and 999: -1 is the last millisecond of the previous second<br>1000 is the first millisecond of the next second

Return Value

Type Description
Number The number of milliseconds from January 1, 1970, midnight 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 using the setUTCMinutes() method:

d output in the current time:


JavaScript Date Object

❮ Prop Input Time Form Jsref Substr ❯