Sets year of date.

Syntax

<oRef>.setYear(<expN>)

<oRef>

The Date object whose year you want to change.

<expN>

The year. For years in the range 1950 to 2049, you can specify the year as either a 2-digit or 4-digit year.

Property of

Date

Description

The setYear( ) method sets the year for the Date object.