DateTime::modify()

It  alters the timestamp

Example

<?php
$date = new DateTime(‘2006-05-17’);
$date->modify(‘+2 day’);
echo $date->format(‘Y-m-d’);
?>

Output

2006-05-19

Share