Adds the specified number of months to a date.This function takes a date, integer, and string value as arguments and returns a date value.
If the date is changed to a month that has fewer days than the original date, the day of the month is decreased to a valid number. For example, if the original date is January 31, and three months are added to it, the returned date is April 30, because April has only 30 days.
DateAddMonths(<date>, <months>, <time_zone>)
The date to add months to.
The number of months to add to the date.
(Optional) The time zone code. This argument specifies the time zone of the date. For example, if you want the date to be in Eastern Standard Time (EST), enter the time zone argument
"EST". If you do not specify a time zone, the local time zone of the user who is completing the form is used.
Assume that you have a form in which there is a date field question with the reference name date_to_shift, and a number field question with the reference name months_to_add. The user is in the EST time zone. In the number field, the user enters
10. In the date field, the user chooses the date January 31, 2000.
- The expression DateAddMonths($date_to_shift, $months_to_add) returns a date value that represents November 30, 2000 12:00 AM EST.
- The expression DateAddMonths($date_to_shift, $months_to_add, "PST") returns a date value that represents November 29, 2000 9:00 PM PST.