Date.setUTCSeconds() (Method)

Sets the UTC seconds value of the time object.

Availability:

ECMAScript edition - 2
JavaScript - 1.3
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Property/method value type:Time value
JavaScript syntax:-myDate.setUTCSeconds(aSecondsValue)
-myDate.setUTCSeconds(aSecondsValue, aMillisecondsValue)
Argument list:aMillisecondsValueAn optional value between 0 and 999 milliseconds
aSecondsValueA value between 0 and 59 seconds

The values are computed as UTC time coordinates.

ECMA mandates that the milliseconds value should be an optional argument. If the milliseconds value is omitted, the current milliseconds value is used as if the value had been supplied with a getUTCMilliseconds() method.

The result of this method is the new time value of the containing object having been adjusted by the values passed in as arguments.

Example code:

   <HTML>
   <HEAD></HEAD>
   <BODY>
   <SCRIPT>
   myDate = new Date();
   myDate.setUTCMilliseconds(0);
   myDate.setUTCSeconds(0);
   myTime = myDate.getTime();
   document.write("The time rounded down to the nearest minute is "  + myTime + " Milliseconds");
   </SCRIPT>
   </BODY>
   </HTML>

See also:Date.getSeconds(), Date.getUTCSeconds(), Date.prototype, Date.setSeconds()

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.27

ECMA 262 edition 3 - section - 15.9.5.31