title: How to convert time from db to minutes and perform operations on them
body: <p>How to convert time from database to minutes and perform operations on them.</p>
  <p>I'm getting from DB datetime like 08:00, 20:00 - it is a time range
  and services duration 00:30 (30 minutes).
  How to count how many services will fit in time range? It should be 720min / 30 min = 20 services</p>
  <p>I'm trying to use strtotime but it return me wrong time.</p>
  <pre><code>$summaryServiceDuring = strtotime($serviceDuration) + strtotime($serviceBuffering);
  $serviceStartTime = strtotime($serviceStart);    
  $serviceEndTime = strtotime($serviceEnd);
  $servicesPerDay =round(abs( $summaryServicesRange/$summaryServiceDuring) ,2);
  </code></pre>
  <p>Now it return 1, but it should 24</p>
  <p>Finally I am using this function:</p>
  <pre><code>public function timeToMinutes($time)
  {
      $time = explode(':', $time);
      return ($time[0] * 60) + ($time[1]) + ($time[2] / 60);
  }
  </code></pre>