DateTime()
and DateInterval()
already do this for you:
$interval = new DateInterval('P3DT4H');
$now = new DateTime();
$now->add($interval);
echo $now->format('Y-m-d H:i:s');
This example adds an interval to "now". You can, of course, make the interval relative to any date and time.
See the interval spec for what valid values are for DateInterval()
.