title: inconsistent day calculations from php
body: <p>This script returns inconsistent days count.
  At localhost returns 14 days on the clients server returns 15 days.</p>
  
  <pre><code>    $_POST['pickup_time'] = '13:30';
      $_POST['dropoff_time'] = '12:00';
      $_POST['pickup_date'] = '2013-10-16';
      $_POST['dropoff_date'] = '2013-10-30';
  
  
      $fmt_pickup_date = strtotime($_POST['pickup_date']);
      $fmt_dropoff_date = strtotime($_POST['dropoff_date']);
  
      $days = ceil(abs($fmt_dropoff_date - $fmt_pickup_date) / 86400);
  
      if ($vehicles[$v]['vehicle_cal_date']==0)
      {
          $fmt_pickup_time = str_replace(":", "", $_POST['pickup_time']);
          $fmt_dropoff_time = str_replace(":", "", $_POST['dropoff_time']);
  
          if (($fmt_dropoff_time-$fmt_pickup_time)&gt;=1)
          {
              $days++;
          }
      }
      else { $days++; }
  </code></pre>
  
  <p>For some dates returns right days count and for some wrong (+1 day).</p>
  
  <pre><code>    [pickup_time] =&gt; 11:00
      [dropoff_time] =&gt; 10:00
      [pickup_date] =&gt; 2013-10-28
      [dropoff_date] =&gt; 2013-11-01
  </code></pre>
  
  <p>These dates returns on both servers 4 days wich is right.</p>
  
  <p>Any ideas? What is wrong?</p>
  
  <p>Edit:</p>
  
  <p>It seems that this:</p>
  
  <pre><code>    date_default_timezone_set('UTC');
  </code></pre>
  
  <p>fixes the problem and now the script returns correct days count for both dates. For how long - no idea. I hope that this will fix it for all the dates :)</p>