Definition :
The date_add() function is a built-in function in PHP.The date_add() function is used to adds some days, months, years, hours, minutes, and seconds to a date.
date_add(object, interval)
Parameter | Description |
---|---|
object | Required. Specifies a DateTime object returned by date_create() |
interval | Required. Specifies a DateInterval object |
Given below examples Add 40 days to the 16th of April, 2015:
Output : 2015-05-26