getDay Method

Microsoft Office JScript

Microsoft® JScript® getDay Method  Language Reference 
Version 1 

See Also                  Applies To


Description
Returns the day of the week value in a Date object using local time.
Syntax
objDate.getDay()
Remarks
To get the day using Universal Coordinated Time (UTC), use the getUTCDay method.

The value returned from the getDay method is an integer between 0 and 6 representing the day of the week and corresponds to a day of the week as follows:

0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday

The following example illustrates the use of the getDay method:

function DateDemo()
{
  var d, day, x, s = "Today is: ";
  var x = new Array("Sunday", "Monday", "Tuesday");
  var x = x.concat("Wednesday","Thursday", "Friday");
  var x = x.concat("Saturday");
  d = new Date();
  day = d.getDay();
  return(s += x[day]);
}