I am using this code to calculate the time period. In fact, I want the period between two HH:MM:SS moment and have a result in HH:MM:SS format.
$time1 = strtotime('00:00:00');
$time2 = strtotime('00:00:07');
$diff = $time2 - $time1;
$diff = date('H:i:s', $diff);
I'm expecting 00:00:07
but I get 01:00:07
. What could be the problem?
Irvin run here, and get right answer but I run the same code on my local machine and wrong!! Is it timezone or maybe some configuration effect the result?!