Skip to main content



AddMonths Function

The AddMonths function adds a specified number of months to a DateTime value.

Syntax

AddMonths(dateTime, numMonths)

The AddMonths function adds a specified number of months to a DateTime value.

Arguments

dateTime DateTime - The base date and time.

numMonths Integer - The number of months to add. A negative value will subtract months.

Remarks

Example:

AddMonths("5/1/2000", 2); // returns 7/1/2000

Example:

AddMonths("5/1/2000", -2); // returns 3/1/2000