PHP date_modify()Functions
PHP Date/Time Reference Manual
Examples
Modify the timestamp. Add 15 days:
<?php
$date=date_create("2013-05-01");
date_modify($date,"+15 days");
echo date_format($date,"Y-m-d");
?>
$date=date_create("2013-05-01");
date_modify($date,"+15 days");
echo date_format($date,"Y-m-d");
?>
Run example »
Definition and Usage
The date_modify() function modifies the timestamp.
Syntax
date_modify(object,modify);
| Parameters | Description |
|---|---|
| object | Required. Specifies adate_create()DateTime object returned by |
| modify | Required. Specifies a date/time string. |
Technical Details
| Return value: | Returns a DateTime object on success. Returns FALSE on failure. |
|---|---|
| PHP Version: | 5.2+ |
| Changelog: | PHP 5.3.0: The return value was changed from NULL to DateTime. |
PHP Date/Time Reference Manual Other Extensions