Date.getUTCDay() (Method)

Returns the UTC weekday 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.getUTCDay()

The result of this method is a weekday number for the date value of the receiving object. The value will be in the range 0 to 6 inclusive. The 0 value represents Sunday.

The value is computed according to UTC time co-ordinates.

Example code:

   <HTML>
   <HEAD></HEAD>
   <BODY>
   <SCRIPT>
   myArray = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
   myDate = new Date();
   document.write(myArray[myDate.getUTCDay()]);
   </SCRIPT>
   </BODY>
   </HTML>

See also:Date.prototype

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.13

ECMA 262 edition 3 - section - 15.9.5.17