Hey guys,
I'm having a little trouble with time manipulation using PHP, was wondering if anybody could help me.
I'm trying to input 2 time strings, and then find their difference.
eg $start==09:00, $finish==10:30,
and get $difference==01:30
My problem is that currently I am able to subtracts hours, but the minutes are not being considered. So the result i get from the above is 01:00 not 01:30. If i had inputted start=9:00, finish=10:59, i'd still get difference=1:00.
Here is my code so far:
$start == 09:00;
$finish ==10:30;
$startConvert == date("H:i", strtotime("".$start));
$finishConvert == date("H:i", strtotime("".$finish));
$difference = $finishConvert - $startConvert;
$differenceConvert = date("H:i", strtotime("".$difference));
Any suggestions would be most appreciated