[Chapter 21] Reference: Date.setYear()
Author: David Flanagan
Date: Fri Aug 29 11:14:46 1997

#

| Chapter 21 JavaScript Reference |

# Date.setYear() Method

## Name

Date.setYear() Method---set the year field of a Date

## Availability

Navigator 2.0, Internet Explorer 3.0

## Synopsis

    date.setYear(year)

### Arguments

`year`

  An integer which is set as the year value for the Date object `date`. Usually, you should use four-digit format for year specifications. For example, specify `2001` for the year 2001. For years within the 20th century, you can also subtract 1900 and specify the date in two-digit format. For example, you could specify `97` for the year 1997.

### Returns

nothing

## See Also

"Date", "Date.getYear()"

Date.setTime() |  | Date.toGMTString()