User Guide
242 Chapter 2: ActionScript Language Reference
Date.getDay()
Availability
Flash Player 5.
Usage
my_date.getDay() : Number
Parameters
None.
Returns
An integer representing the day of the week.
Description
Method; returns the day of the week (0 for Sunday, 1 for Monday, and so on) of the specified
Date object according to local time. Local time is determined by the operating system on which
Flash Player is running.
Example
The following example creates a new Date object and uses getDay() to determine the current day
of the week
:
var dayOfWeek_array:Array = new Array("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday", "Saturday");
var today_date:Date = new Date();
var day_str:String = dayOfWeek_array[today_date.getDay()];
trace("Today is "+day_str);