I use this code to calculate difference between two dates in hours and minutes :
$all = round(($date1timestamp - $date2timestamp) / 60);
$d = floor ($all / 1440);
$h = floor (($all - $d * 1440) / 60);
$m = $all - ($d * 1440) - ($h * 60);
Works perfectly but when I must multiple times to calculate difference between dates I must write code again and change values is there any simple way to calculate multiple times without rewrite code again ??
Try:
Function:
Calling the function: