Date Class — current time and structured support for date information


Flash 5


new Date( )
new Date(milliseconds)
new Date(year, month, day, hours, minutes, seconds, ms)



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).


An integer specifying the year. Required when using the year ,... ms constructor format. If year is one or two digits, it is treated as the number of years since 1900 (e.g., a year 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 when year is negative or less than 800, the calculation is unreliable. To specify dates prior to 1000 A.D., it’s safest to use the single milliseconds constructor format.


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, a month of 13 is ...

Get ActionScript: The Definitive Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.