Date.getUTCSeconds() (Method)

Returns the UTC seconds value for a date/time.

Availability:

ECMAScript edition - 2
JavaScript - 1.3
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Property/method value type:Number primitive
JavaScript syntax:-myDate.getUTCSeconds()

The result of this method is the seconds part of the time value contained in the receiving object. The value will be in the range 0 to 59 inclusive.

The value is computed according to UTC time coordinates.

Example code:

   <!-- A bar chart indicating seconds of the minute -->

   <HTML>

   <HEAD></HEAD>

   <BODY>

   <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>

   <TR HEIGHT=10>

   <TD ID="LEFT"  WIDTH=100 STYLE="background-color:RED"> </TD>

   <TD ID="RIGHT" WIDTH=500 STYLE="background-color:BLUE"> </TD>

   </TR>

   </TABLE>

   <SCRIPT>

   setBar()

   setInterval("setBar()", 990);

   function setBar()

   {

   myDate    = new Date();

   mySeconds = myDate.getUTCSeconds();

   myOther   = 60 - mySeconds;

   document.all.LEFT.style.width  = 1+mySeconds*10;

   document.all.RIGHT.style.width = 1+myOther*10;

   }

   </SCRIPT>

   </BODY>

   </HTML>

See also:Date.prototype, Date.setUTCSeconds()

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.19

ECMA 262 edition 3 - section - 15.9.5.23