JavaScript setUTCMinutes () method
Examples
UTC time is set according to the number of minutes in paragraph 17:
var d = new Date();
d.setUTCMinutes(17);
d.setUTCMinutes(17);
d output in local time:
try it"
Definition and Usage
setUTCMinutes () method is used to set the minute specified time according to Universal Time (UTC).
Tip: Coordinated Universal Time, also known as the unified world time, Universal Time, Coordinated Universal Time, abbreviated UTC (Universal Coordinated Time).
Note: UTC time is the GMT (Greenwich Mean) time.
Browser Support
All major browsers support setUTCMinutes () method
grammar
Date.setUTCMinutes( min , sec , millisec )
Parameter Values
参数 | 描述 |
---|---|
min | 必需。要给 date Object 设置的分钟字段的值,用世界时表示。
该参数应该是 0 ~ 59 之间的整数:
|
sec | 可选。要给 dateObject 设置的秒字段的值。使用世界时表示。
该参数是 0 ~ 59 之间的整数:
|
millisec | 可选。要给 date Object 设置的毫秒字段的值。使用世界时表示。
该参数是 0 ~ 999 之间的整数:
|
return value
类型 | 描述 |
---|---|
Number | 1970 年 1月 午夜至设置时间的毫秒数。 |
technical details
JavaScript version: | 1.3 |
---|
More examples
Examples
In this example, we will () method to set the current time minute field by setUTCMinutes 90 minutes ago:
var d = new Date();
d.setUTCMinutes(d.getUTCMinutes()-90);
d.setUTCMinutes(d.getUTCMinutes()-90);
d output according to the current time:
try it"