Answers for "get hours between created at and today 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
0

php calculate hours and minutes between two times

date_default_timezone_set("Africa/Johannesburg");
    $now = new DateTime();
    $future_date = new DateTime('2020-10-21 00:00:00');
    
    $interval = $future_date->diff($now);
    
    echo ($interval->format("%a") * 24) + $interval->format("%h"). " hours". $interval->format(" %i minutes ");
    print_r($now->format('Y-m-d H:i:s'));
Posted by: Guest on December-08-2021

Code answers related to "get hours between created at and today php"

Browse Popular Code Answers by Language