title: Calculate difference beween two dates in hours and minutes
body: <p>I use this code to calculate difference between two dates in hours and minutes :</p>
  
  <pre><code>$all = round(($date1timestamp - $date2timestamp) / 60);
  $d = floor ($all / 1440);
  $h = floor (($all - $d * 1440) / 60);
  $m = $all - ($d * 1440) - ($h * 60);
  </code></pre>
  
  <p>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 ??</p>