Date class
Availability
Flash Player 5.
Description
The Date class lets you retrieve date and time values relative to universal time (Greenwich Mean
Time, now called universal time or UTC) or relative to the operating system on which Flash
Player is running. The methods of the Date class are not static but apply only to the individual
Date object specified when the method is called. The
static method.
The Date class handles daylight saving time differently, depending on the operating system and
Flash Player version. Flash Player 6 and later versions handle daylight saving time on the
following operating systems in these ways:
•
Windows—the Date object automatically adjusts its output for daylight saving time. The Date
object detects whether daylight saving time is employed in the current locale, and if so, it
detects the standard-to-daylight saving time transition date and times. However, the transition
dates currently in effect are applied to dates in the past and the future, so the daylight saving
time bias might calculate incorrectly for dates in the past when the locale had different
transition dates.
•
Mac OS X—the Date object automatically adjusts its output for daylight saving time. The
time zone information database in Mac OS X is used to determine whether any date or time in
the present or past should have a daylight saving time bias applied.
•
Mac OS 9—the operating system provides only enough information to determine whether the
current date and time should have a daylight saving time bias applied. Accordingly, the date
object assumes that the current daylight saving time bias applies to all dates and times in the
past or future.
Flash Player 5 handles daylight saving time on the following operating systems as follows:
•
Windows—the U.S. rules for daylight saving time are always applied, which leads to incorrect
transitions in Europe and other areas that employ daylight saving time but have different
transition times than the U.S. Flash correctly detects whether daylight saving time is used in
the current locale.
To call the methods of the Date class, you must first create a Date object using the constructor for
the Date class, described later in this section.
Method summary for the Date class
Method
Date.getDate()
Date.getDay()
Date.getFullYear()
Date.getHours()
ActionScript Language Reference
Description
Returns the day of the month according to local time.
Returns the day of the week according to local time.
Returns the four-digit year according to local time.
Returns the hour according to local time.
Date.UTC()
method is an exception; it is a
CHAPTER 2
Date class
237
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?