Date.getUTCDate() (Method)

Returns the UTC day of month 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.getUTCDate()

This method returns a day number within a month from the date value of the receiving object. The value is 1 based and will not exceed 31 although the range is variable based on month and leap year contexts.

The date is computed according to UTC time coordinates.

Example code:

   <HTML>

   <HEAD>

   </HEAD>

   <BODY>

   <SCRIPT>

   // Create diary of special days per month

   myDiary = new Array();

   myDiary[1]  = "Pay into bank account";

   myDiary[28] = "Invoice customers";

   myDiary[14] = "Chase customers for payment";

   myDiary[5]  = "Top up fuel in generator";

   // Work out day number

   myDate = new Date();

   myDay = myDate.getUTCDate();

   // Output message of the day

   document.write(myDiary[myDay]);

   </SCRIPT>

   </BODY>

   </HTML>

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

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.11

ECMA 262 edition 3 - section - 15.9.5.15