Modify timestamp. Add 15 days:
<?php$date=date_create("2013-05-01");date_modify($date,"+15 days");echo date_format($date,"Ymd");?>The date_modify() function modifies the timestamp.
date_modify( object,modify);
parameter | describe |
---|---|
object | Required. Specifies a DateTime object returned by date_create(). |
modify | Required. Specifies a date/time string. |
Return value: | If successful, a DateTime object is returned. Returns FALSE on failure. |
---|---|
PHP version: | 5.2+ |
Update log: | PHP 5.3.0: Return value changed from NULL to DateTime. |