EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Setyear (Date.setyear Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Date 503
millisecond:Number [optional] - An integer from 0 to 999. If you omit this parameter, the
milliseconds field of the specified Date object will not be modified.
Returns
Number - An integer.
Example
The following example initially creates a new Date object, setting the time and date to
8:00:00 a.m. on May 15, 2004, and uses
Date.setSeconds() to change the time to 8:30:45
a.m.:
var my_date:Date = new Date(2004,4,15,8,0,0);
trace(my_date.getUTCSeconds()); // output: 0
my_date.setUTCSeconds(45);
trace(my_date.getUTCSeconds()); // output: 45
setYear (Date.setYear method)
public setYear(year:Number) : Number
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.
Availability: ActionScript 1.0; Flash Player 5
Parameters
year:Number - A number that represents the year. If year is an integer between 0 and 99,
setYear sets the year at 1900 + year; otherwise, the year is the value of the year parameter.
Returns
Number - An integer.
Example
The following example creates a new Date object with the date set to May 25, 2004, uses
setYear() to change the year to 1999, and changes the year to 2003:
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);

Table of Contents

Related product manuals