0
Right now I have the time difference working but as I have it makes the difference in hours, that is, from 11:00 to 12:30 the difference is 1:30 and I enter 1.30, but I wanted him to enter 1.50.
I want the time difference in units, not hours.
$inicio = new DateTime($horai);
$fim = new DateTime($horaf);
$intervalo = $inicio->diff($fim);
$dhora = $intervalo->format('%H.%i');
Want to 'round up' the difference? what is the criterio?
– rray
I just want the time difference in units.
– Xeoon
There is no parameter to format in this form. Take the minute difference and divide by 60. Then add the time difference
– Adir Kuhn
Why 1.50 if the correct is 1.30, do you want to add another 20 minutes? If you want the difference in minutes, just convert the hours into minutes and add up to the 30 minutes. If you want the difference in hours, take the minutes and divide by 60 and add to the hours.
– Ivan Ferrer