Answers for "adding seconds hour for datetime in php"

PHP
1

php add hours to current date

$new_time = date("Y-m-d H:i:s", strtotime('+5 hours'));
Posted by: Guest on April-26-2020
1

add seconds to datetime php

<?php 
$date = new DateTime();
echo $date->getTimestamp(). "<br>";
$date->add(new DateInterval('PT674165S')); // adds 674165 secs
echo $date->getTimestamp();
?>
Posted by: Guest on July-06-2020

Browse Popular Code Answers by Language