Date.setYear()
Availability
Flash Player 5.
Usage
my_date.setYear(year:Number) : Number
Parameters
A number that represents the year. If
year
year at 1900 +
year
Returns
An integer.
Description
Method; sets the year for the specified Date object in 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 creates a new Date object with the date set to May 25, 2004, uses
to change the year to 1999, and changes the year to 2003:
setYear()
var my_date:Date = new Date(2004,4,25);
trace(my_date.getYear()); // output: 104
trace(my_date.getFullYear()); // output: 2004
my_date.setYear(99);
trace(my_date.getYear()); // output: 99
trace(my_date.getFullYear()); // output: 1999
my_date.setYear(2003);
trace(my_date.getYear()); // output: 103
trace(my_date.getFullYear()); // output: 2003
; otherwise, the year is the value of the
is an integer between 0–99,
year
parameter.
year
sets the
setYear
Date.setYear()
275
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers