skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Add months
 

Try Corticon Now

Add months

SYNTAX

<DateTime>.addMonths(<Integer>)
<Date>.addMonths(<Integer>)

DESCRIPTION

Adds the number of months in <Integer> to the number of months in <DateTime> or <Date>.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

This sample Rulesheet uses . addMonths in a Nonconditional rule to add 10 months to the value of dateTime2 and assign the result to dateTime1.

SAMPLE RULETEST

A sample Ruletest provides values of dateTime2 for three instances of Entity1. Input and Output panels are shown below. Notice the year portion of dateTime1 also changes accordingly.