title: time difference in hours and min in php HH:MM format for d/m/Y - h:ia
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13002723/get-difference-in-time-in-hhmm-format-php">get difference in time in HH:MM format php</a>  </p>
  </blockquote>
  
  
  
  <p>my time format is d/m/Y - h:ia</p>
  
  <p>example output is 21/10/2012 - 03:49pm</p>
  
  <p>I'm using this code to calculate the difference between $from and $to</p>
  
  <pre><code> $to = strtotime("21/10/2012 - 10:30pm");
   $from = strtotime("22/10/2012 - 8:30am");
   $stat = date("H\h:i\m", abs($to - $from));
  </code></pre>
  
  <p>but I'm alwys getting an incorrect value</p>
  
  <p>for the example above I got an output of 16h:00m but it should be 10h:00m</p>
  
  <p>is there a much more efficient and effective way to do this?</p>