Skip to main content

Date.AddMonths

Adds the specified months to the date.

Syntax

Date.AddMonths(
dateTime as any,
numberOfMonths as number
) as any

Remarks

Returns the date, datetime, or datetimezone result from adding numberOfMonths months to the datetime value dateTime.

  • dateTime: The date, datetime, or datetimezone value to which months are being added.
  • numberOfMonths: The number of months to add.

Examples

Example #1

Add 5 months to the <code>date</code>, <code>datetime</code>, or <code>datetimezone</code> value representing the date 5/14/2011.

Date.AddMonths(#date(2011, 5, 14), 5)

Result:

#date(2011, 10, 14)

Example #2

Add 18 months to the <code>date</code>, <code>datetime</code>, or <code>datetimezone</code> value representing the date and time of 5/14/2011 08:15:22 AM.

Date.AddMonths(#datetime(2011, 5, 14, 8, 15, 22), 18)

Result:

#datetime(2012, 11, 14, 8, 15, 22)

Category

Date