Setyear (Date.setyear Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

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
to change the time to 8:30:45
Date.setSeconds()
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 Lite 2.0
Parameters
- A number that represents the year. If
is an integer between 0 and 99,
year:Number
year
sets the year at 1900 +
; otherwise, the year is the value of the
parameter.
setYear
year
year
Returns
- An integer.
Number
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
Date
355

Advertisement

Table of Contents
loading

Table of Contents