title: php date and daylight savings time confusion
body: <p>I've got a problem and I'm 99% convinced its related to Daylight Savings Time starting yesterday.</p>
  
  <p>The following script:</p>
  
  <pre><code>&lt;?php
   $i=1383451200;
   echo $i, " ", date('Y-m-d I', @$i);
   echo "\n";
   $i = $i + 86400;
   echo $i, " ", date('Y-m-d I', @$i);
   echo "\n";
  ?&gt;
  </code></pre>
  
  <p>(where 86400 is the number of seconds in a day)</p>
  
  <p>gives the following output</p>
  
  <p>1383451200 2013-11-03 1
  1383537600 2013-11-03 0</p>
  
  <p>2 timestamps, separated by the number of seconds in a day, fed into date(), giving the SAME date of 2013-11-03</p>
  
  <p>Since it IS 11/3/2013 AND I KNOW we switched to Daylight Savings Time AND the I format specifier indicates one timestamp is in DST and one is not I think its safe to say I've got something misconfigured on my system.</p>
  
  <p>The question is, how to fix it?  I have already done:</p>
  
  <p>pecl install timezonedb</p>
  
  <p>and added the following to php.ini</p>
  
  <p>extension=/usr/lib/php5/20100525/timezonedb.so</p>
  
  <p>on my system.  </p>
  
  <p>My system is Ubuntu 12.10 on a Macbook Pro and I'm using php 5</p>
  
  <p>Any suggestions how to fix this?</p>
  
  <p>Here's what I'm trying to do.  I want to print out date for every day in a month.</p>
  
  <pre><code>$startTime = strtotime($start);
  $endTime = strtotime($end);
  </code></pre>
  
  <p>where $start and $end are strings of the form YYYY-MM-DD (and the user can specify them)</p>
  
  <p>The individual days of the month are calculated as:</p>
  
  <pre><code>for ($i = $startTime; $i &lt;= $endTime; $i = $i + 86400) {
       $thisDate = date('Y-m-d', $i); 
  }
  </code></pre>
  
  <p>I want this to print out the date of every day in the month from the start to the end of the of the possibly user specified range.</p>
  
  <p>Mark</p>