JavaScript setUTCMilliseconds () method
Examples
According to Universal Time (UTC) setting specifies the number of milliseconds to 192:
var d = new Date();
d.setUTCMilliseconds(192);
var n = d.getUTCMilliseconds();
d.setUTCMilliseconds(192);
var n = d.getUTCMilliseconds();
n output:
try it"
Definition and Usage
setUTCMilliseconds () method is used to set a specified time in milliseconds 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).
Tip: UTC time is the GMT (Greenwich Mean) time.
Browser Support
All major browsers support setUTCMilliseconds () method.
grammar
Date.setUTCMilliseconds( millisec )
Parameter Value
参数 | 描述 |
---|---|
millisec | 必需。要给 dateObject 设置的毫秒字段的值。使用世界时表示。
该参数是 0 ~ 999 之间的整数:
|
return value
Type | 描述 |
---|---|
Number | 返回 1970 年 1月 1日 午夜至设置指定毫秒数时间之间的毫秒数。 |
technical details
JavaScript version: | 1.3 |
---|