Description
The setUTCSeconds() method sets the seconds (from 0 to 59), according to universal time.
This method has the form:
Date.setUTCSeconds(sec,millisec)
Parameter | Description |
---|---|
sec | (required) An integer between 0 and 59 representing the seconds |
millisec | (optional) An integer between 0 and 999 representing the milliseconds |
Examples
The following example shows the basic use of this method.
<script>
var d = new Date();
d.setUTCSeconds(1);
document.write(d);
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|