Adds months to a datetime.
A new datetime.
|Datetime||A datetime in OI internal format. (REQUIRED)|
|Months||The number of months to add. (REQUIRED)|
The "AddMonths" service calculates a new datetime by adding the given number of months to an existing datetime. You can pass whole numbers or decimal numbers. You can also pass negative values to subtract months.
Note that months are an abstract concept, so adding months is also done abstractly. If the current month is February 28, and you add 1 whole month, you will get March 28. In other words, whole months are added without altering the day of the month, unless the day would be invalid. As an example, If you add 1 whole month to January 31, you'll get February 28. Fractions of a month are calculated using the average month length, which is 30.4375. For example, if you add 1.5 months to February 28, you'll get April 12th, which is 15 days (half of 30.4375) after March 28th.
Note also that this method never alters the time of day.