I used:
<?php
echo date("H:i:s", $var_time_diff);
?>
build time between two dates .. and in my head it was
$var_time_diff = 36000 = display 10:00:00 for 10 hours.
But actually
<?php echo date("H:i:s", 0);?>
display 01:00:00, not 00:00:00.
So we have
$date_a = "18:15:04";
$date_b = "23:15:04";
$diff = strtotime($date_b) - strtotime($date_a);
Everything is in order at the moment $diffis 5 hours, but if we indicate the date as follows:
echo date("H:i:s", $diff);
will be "06:00:00".
So is something wrong with my php config or is this normal behavior for php function date?
source
share