Date.getDay() (Method)

Returns the weekday number for 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.getDay()

A weekday number for the date value of the receiving object is returned. The value will be in the range 0 to 6, with 0 representing Sunday.

The value is computed according to Local time coordinates.

Example code:

   <HTML>

   <HEAD></HEAD>

   <BODY>

   <SCRIPT>

   myArray = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");

   myDate = new Date();

   document.write(myArray[myDate.getDay()]);

   </SCRIPT>

   </BODY>

   </HTML>

See also:Date.prototype

Cross-references:

ECMA 262 edition 2 - section - 15.9.5.12

ECMA 262 edition 3 - section - 15.9.5.16