Answers for "how to get hours and minustes in php two dates"

PHP
7

get hours difference between two dates in php

$hourdiff = round((strtotime($time1) - strtotime($time2))/3600, 1);
Posted by: Guest on June-30-2020
0

php datetime sub minutes

$datetime = new DateTime();

//PT 'TIME' M
//PT30S -> 30 Seconds
//PT30M -> 30 Minutes
//PT30H -> 30 Hours
$datetime->sub(new DateInterval('PT12H30M'));
Posted by: Guest on May-26-2021

Code answers related to "how to get hours and minustes in php two dates"

Browse Popular Code Answers by Language