O'Reilly logo

ActionScript: The Definitive Guide by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required