Name
Date.setYear( ) Method — assign the year, relative to 1900
Availability
Flash 5
Synopsis
date.setYear(year, month, day)
Arguments
- year
A required integer specifying the new year of
date
. If one or two digits are supplied, the year is assumed to be in the 20th century. For example, 1 is the year 1901, and 99 is the year 1999. Three-digit years are assumed to be pre-1000 A.D. Use four digits to specify the year 2000 and later.
- month
An optional integer from 0 (January) to 11 (December), not from 1 to 12, representing the new month of the year of
date
.
- day
An optional integer from 1 to 31 representing the new day of the month of
date
.
Returns
An integer representing the number of milliseconds between the new date and midnight, January 1, 1970.
Description
setYear( )
is identical to setFullYear( )
except that it interprets one- and two-digit years as being relative to 1900 whereas setFullYear( )
interprets them as being relative to 0 A.D.
See Also
Date.getYear( )
, Date.setFullYear(
)
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.