User Guide

274 Chapter 6: ActionScript Core Classes
Returns
An integer.
Description
Method; returns the year of the specified Date object, according to local time. Local time is
determined by the operating system on which Flash Player is running. The year is the full year
minus 1900. For example, the year 2000 is represented as 100.
Example
The following example creates a Date object with the month and year set to May 2004. The
Date.getYear() method returns 104, and Date.getFullYear() returns 2004:
var today_date:Date = new Date(2004,4);
trace(today_date.getYear()); // output: 104
trace(today_date.getFullYear()); // output: 2004
See also
Date.getFullYear()
Date.setDate()
Availability
Flash Player 5.
Usage
my_date.setDate(date) : Number
Parameters
date
An integer from 1 to 31.
Returns
An integer.
Description
Method; sets the day of the month for the specified Date object, according to local time, and
returns the new time in milliseconds. Local time is determined by the operating system on which
Flash Player is running.
Example
The following example initially creates a new Date object, setting the date to May 15, 2004, and
uses
Date.setDate() to change the date to May 25, 2004:
var today_date:Date = new Date(2004,4,15);
trace(today_date.getDate()); //displays 15
today_date.setDate(25);
trace(today_date.getDate()); //displays 25