Skip to content

cDate::AddMonths()

Rainer Stötter edited this page May 9, 2017 · 15 revisions

Method AddMonths( )

 public   mixed libdatephp\cDate::AddMonths(integer $diff)

AddMonths() adds / subtracts $diff months to / from the managed date. If the target month has too less days then the target date will be set on the next fitting date in the next month: If the start date has the 31th and is in January, then the target day will be the 3rd March, if the february has 28 days.

Example:

Arguments

  • $diff integer - <p>the number of months to add / subtract. It defaults to 1</p>

See also

Clone this wiki locally