getDay (JavaScript)

Gets the day of the week in local time.

Defined in

Date (Standard - JavaScript)

Syntax

getDay() : int
Return value Description
int The day of the week where 0 is Sunday.

Examples

This computed label gets the day of the week and displays it as a string.
var date = new Date();
var day;
switch(date.getDay()) {
	case 0 : day = "Sunday"; break;
	case 1 : day = "Monday"; break;
	case 2 : day = "Tuesday"; break;
	case 3 : day = "Wednesday"; break;
	case 4 : day = "Thursday"; break;
	case 5 : day = "Friday"; break;
	case 6 : day = "Saturday"; break;
}
day + ", " + date.toString()