title: Time diff in minutes between 2 dates
body: <p>Got this working on php 5.3 </p>
  
  <pre><code>$datetime1 = new DateTime("2011-10-10 10:00:00");
  $datetime2 = new DateTime("2011-10-10 10:45:00");
  $interval = $datetime1-&gt;diff($datetime2);
  $hours   = $interval-&gt;format('%h'); 
  $minutes = $interval-&gt;format('%i');
  echo 'Diff. in minutes is: '.($hours * 60 + $minutes); 
  </code></pre>
  
  <p>How can i make it work on php 5.2 ? are there any equivalent functions available?? </p>
  
  <p><strong>Got it working</strong> </p>
  
  <pre><code>$date1 = "2011-10-10 10:00:00";
  $date2 = "2011-10-10 10:11:00";
  echo round((strtotime($date2) - strtotime($date1)) /60);
  </code></pre>