Date.getMinutes() (Method)

Returns the minutes value of a date/time.

Availability:

ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server - 2.0
Opera - 3.0
Property/method value type:Number primitive
JavaScript syntax:-myDate.getMinutes()

The minutes of the time value contained in the receiving object. The result will be an integer in the range 0 to 59 inclusive.

The value is computed according to local time coordinates.

Example code:

   <!-- A bar chart indicating minutes of the hour -->
   <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()", 60000);
   function setBar()
   {
   myDate    = new Date();
   myMinutes = myDate.getMinutes();
   myOther   = 60 - myMinutes;
   document.all.LEFT.style.width  = 1+myMinutes*10;
   document.all.RIGHT.style.width = 1+myOther*10;
   }
   </SCRIPT>
   </BODY>
   </HTML>

See also:Date.prototype, Date.setMinutes(), Date.setUTCMinutes()

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.16

ECMA 262 edition 3 - section - 15.9.5.20