JavaScript setMilliseconds () method
Examples
Field specifies the time in milliseconds for the 192:
var d = new Date();
d.setMilliseconds(192);
var n = d.getMilliseconds();
d.setMilliseconds(192);
var n = d.getMilliseconds();
n output:
try it"
Definition and Usage
setMilliseconds () method is used to set the milliseconds field of the specified time.
Browser Support
All major browsers support setMilliseconds () method
grammar
Date.setMilliseconds( millisec )
Parameter Value
参数 | 描述 |
---|---|
millisec | 必需。用于设置 dateObject 毫秒字段。
该参数是介于 0 ~ 999 之间的整数:
|
return value
类型 | 描述 |
---|---|
Number | 1970年1月1日午夜至调整过的日期的毫秒表示。 |
technical details
JavaScript version: | 1.3 |
---|