Possible Duplicate:
What date/time functions to use for PHP 5.2
I want to add a duration to a date, I set this code :
$date = new DateTime(Date('r'));
$date = $date->format("d-m-Y H:i:s");
$interval = new DateInterval('PT1H2M3S');
$date = $date->add($interval);
echo $date;
and I get this error : Class ‘DateInterval’ not found
Why is this and how can I modify the date without DateInterval?
I use
strtotime. Maybe not the best, but certainly the easiest way:or if you need the interval from now use just: