title: Difference between timestamps PHP decimal format
body: <p>Im trying to get the difference between to timestamps in PHP.</p>
  
  <p>For instance I have a login time</p>
  
  <pre><code>  $login = "2014-11-24 13:45:00";
    $current_time = date('Y-m-d H:i:s');  // Lets pretend its 2014-11-24 14:50:00
  </code></pre>
  
  <p>I want to compare the login time with the current time, and show it in two formats</p>
  
  <p>The obvious display I already have is this.  Showing the difference.</p>
  
  <pre><code>  01:05:00 // Time difference
  </code></pre>
  
  <p>But I also want to have this be in a decimal format for calculations.
  How can I convert the above 'difference' to a decimal display.??</p>
  
  <pre><code>  1.083  // In this case 1:05 difference calculates to 1.083 in decimal 
  </code></pre>
  
  <p>More examples...</p>
  
  <pre><code> 00:30:00 // half hour difference
   0.5 // Decimal
  
   00:45:00 // 45 minutes
   0.75 // Decimal
  
   03:14:00 // 3 hours 14 minutes
   3.23 // Decimal
  </code></pre>