addMonth()

Adds or subtracts the specified amount of time to the given Month field, based on the calendar's rules.

Syntax

Calendar addMonth(Numeric amount)
  1. amount is the amount of date or time to be added to the Month field.

Usage

For example, add 10 months to the current Month field by calling:
Calendar.fromDate(Date.parseString("08/31/1999","mm/dd/yyyy")).addMonth(10).toDate().format("mm/dd/yyyy")
This example populates a Word Box. To achieve the same goal and populate a Date box, call:
Calendar.fromDate(Date.parseString("08/31/1999","mm/dd/yyyy")).addMonth(10).toDate()