PHP: add seconds to a date

If you are using php 5.3+ you can use a new way to do it.

<?php 
$date = new DateTime();
echo $date->getTimestamp(). "<br>";
$date->add(new DateInterval('PT674165S')); // adds 674165 secs
echo $date->getTimestamp();
?>

Leave a Comment