User Guide

264 Chapter 6: ActionScript Core Classes
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);
Date.getFullYear()
Availability
Flash Player 5.
Usage
my_date.getFullYear() : Number
Parameters
None.
Returns
An integer representing the year.
Description
Method; returns the full year (a four-digit number, such as 2000) 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 uses the constructor to create a Date object and send the value returned by
the
getFullYear() method to the log file:
var my_date:Date = new Date();
trace(my_date.getYear()); // displays 104
trace(my_date.getFullYear()); // displays current year
Date.getHours()
Availability
Flash Player 5.
Usage
my_date.getHours() : Number
Parameters
None.