Language Reference setMonth Method


Description

Modifies the month stored in the Date object.

Syntax

dateObj.setMonth( numMonth )

Arguments

numMonth: A numeric value equal to the desired minutes value.

Remarks

If the value of numMonth is greater than 11 (remember, January is month 0) or negative, the stored year will be modified accordingly. For example, if the stored date is "Jan 5, 1996" and setMonth(14) is called, the date will be changed to "Mar 5, 1997."