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
millisecondsargument 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,...msconstructor format. Ifyearis one or two digits, it is treated as the number of years since 1900 (e.g., ayearof 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 whenyearis negative or less than 800, the calculation is unreliable. To specify dates prior to 1000 A.D., it’s safest to use the singlemillisecondsconstructor format.
- month
An integer specifying the month, from ( January) to 11 (December), not from 1 to 12. Required when using the
year,...msconstructor format. Out-of-range months are carried over to the next or previous year. For example, amonthof 13 is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access