JavaScript setUTCSeconds () method
Examples
According to Universal Time (UTC) in seconds of the current time field is set to 35:
d.setUTCSeconds(35);
d output:
try it"
Definition and Usage
setUTCSeconds () method is used according to Universal Time (UTC) setting specifies the time in seconds field.
This method is suitable for a specified time to set the seconds field.
Tip: Coordinated Universal Time, also known as the unified world time, Universal Time, Coordinated Universal Time, abbreviated UTC.
Note: UTC time and GMT (Greenwich Mean) time the same.
Browser Support
All major browsers support setUTCSeconds () method.
grammar
Parameter Values
parameter | description |
---|---|
sec | Required. DateObject give the value of the seconds field. It indicates the use of the world. This parameter is an integer from 0 to 59:
|
millisec | Optional. Millisecond value field to give dateObject settings. It indicates the use of the world. This parameter is an integer from 0 to 999:
|
return value
Type | 描述 |
---|---|
Number | 调整过的日期的毫秒表示。 |
technical details
JavaScript version: | 1.3 |
---|
More examples
Examples
According to Universal Time (UTC) to set the number of seconds and milliseconds:
d.setUTCSeconds(35,825);
var n=d.getUTCSeconds() + ":" + d.getUTCMilliseconds();
n output:
try it"