The date_modify() function modifies the timestamp.
PHP date_modify() Function has the following syntax.
date_modify(object,modify);
Parameter | Is Required | Description |
---|---|---|
object | Required. | DateTime object returned by date_create() |
modify | Required. | Date/time string |
PHP date_modify() Function returns a DateTime object on success. FALSE on failure.
Add 15 days to the timestamp
<?php
$date=date_create("2013-05-01");
date_modify($date,"+15 days");
echo date_format($date,"Y-m-d");
?>
The code above generates the following result.