Name
Date Class — current time and structured support for date information
Availability
Flash 5
Constructor
new Date( ) new Date(milliseconds) new Date(year, month, day, hours, minutes, seconds, ms)
Arguments
- milliseconds
The number of milliseconds between the new date and midnight of January 1, 1970 UTC (Coordinated Universal Time, akin to GMT). Positive if after; negative if before. Any required local time zone adjustment is made after the date in UTC time is determined. For example, specifying a
milliseconds
argument of 1000 in Eastern Standard Time would create a date 1 second past midnight on January 1, 1970 in UTC time, which translates to 7:00:01 p.m. on December 31, 1969 in EST time (5 hours behind UTC time).
- year
An integer specifying the year. Required when using the
year
,...
ms
constructor format. Ifyear
is one or two digits, it is treated as the number of years since 1900 (e.g., ayear
of 11 always refers to the year 1911, not 2011). Use four-digit numbers to specify year 2000 or later (e.g., use 2010, not 10). Three-digit years are treated as pre-1000 A.D. Note that whenyear
is negative or less than 800, the calculation is unreliable. To specify dates prior to 1000 A.D., it’s safest to use the singlemilliseconds
constructor format.
- month
An integer specifying the month, from ( January) to 11 (December), not from 1 to 12. Required when using the
year
,...
ms
constructor format. Out-of-range months are carried over to the next or previous year. For example, amonth
of 13 is ...
Get ActionScript: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.