Date.getUTCMonth() (Method)

Returns the UTC month number 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.getUTCMonth()

The result of this method is month number for the receiving date object. The value will be in the range 0 to 11 inclusive, with the value 0 representing January, and 11 representing December.

The month number is measured in UTC time coordinates.

Example code:

   <HTML>
   <HEAD></HEAD>
   <BODY>
   <SCRIPT>
   myDate  = new Date();
   myMonth = myDate.getUTCMonth();
   egyptianSeasons(myMonth);
   // Generate attributes of the egyptian calendar based on month
   function egyptianSeasons(aMonth)
   {
   mySeasonArray = new Array("Akhet", "Peret", "Shemu");
   myMonthArray  = new Array("I", "II", "III", "IV");
   mySeason = mySeasonArray[Math.floor(aMonth/4)];
   myMonth  = myMonthArray[aMonth%4];
   document.write("Index : "  + aMonth   + "<BR>");
   document.write("Season : " + mySeason + "<BR>");
   document.write("Month : "  + myMonth  + "<BR>");
   }
   </SCRIPT>
   </BODY>
   </HTML>

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

Cross-references:

ECMA 262 edition 2 - section - 15.5.9.9

ECMA 262 edition 3 - section - 15.9.5.13