title: PHP error checking for DST, Daylight Savings Time
body: <p>Since the time has just changed the past weekend in places that use Daylight Savings Time I'm sure there's going to be a few queries related to this.</p>
  
  <p>I am trying to determine if a date used DST or not.  For this I assume the 30th of October 2011 does not use DST, as the switch occurred on that date..is this correct?</p>
  
  <p>Here is the code (I would expect Oct 30th to not use DST ):</p>
  
  <pre><code>&lt;?php
  echo "Timezone = " . date_default_timezone_get();
  echo "&lt;/br&gt;";
  
  $dateOct29='2011-10-29';
  $dateOct29Timestamp=strtotime($dateOct29,time());
  $checkDayLightSavingOct29=date('I',$dateOct29Timestamp);
  echo "Date : ".$dateOct29." Timestamp : ".$dateOct29Timestamp." Formatted ('Y-m-d Z T'): ".date('Y-m-d Z T',$dateOct29Timestamp)."&lt;/br&gt;";
  echo "Result of date('I',timestamp) : ". $checkDayLightSavingOct29."&lt;/br&gt;";
  
  $dateOct30='2011-10-30';
  $dateOct30Timestamp=strtotime($dateOct30,time());
  $checkDayLightSavingOct30=date('I',$dateOct30Timestamp);
  echo "Date : ".$dateOct30." Timestamp : ".$dateOct30Timestamp." Formatted ('Y-m-d Z T'): ".date('Y-m-d Z T',$dateOct30Timestamp)."&lt;/br&gt;";
  echo "Result of date('I',timestamp) : ". $checkDayLightSavingOct30."&lt;/br&gt;";
  
  $dateOct31='2011-10-31';
  $dateOct31Timestamp=strtotime($dateOct31,time());
  $checkDayLightSavingOct31=date('I',$dateOct31Timestamp);
  echo "Date : ".$dateOct31." Timestamp : ".$dateOct31Timestamp." Formatted ('Y-m-d Z T'): ".date('Y-m-d Z T',$dateOct31Timestamp)."&lt;/br&gt;";
  echo "Result of date('I',timestamp) : ". $checkDayLightSavingOct31."&lt;/br&gt;";
  
  $dateNov01='2011-11-01';
  $dateNov01Timestamp=strtotime($dateNov01,time());
  $checkDayLightSavingNov01=date('I',$dateNov01Timestamp);
  echo "Date : ".$dateNov01." Timestamp : ".$dateNov01Timestamp." Formatted ('Y-m-d Z T'): ".date('Y-m-d Z T',$dateNov01Timestamp)."&lt;/br&gt;";
  echo "Result of date('I',timestamp) : ". $checkDayLightSavingNov01."&lt;/br&gt;";
  
  
  ?&gt;
  </code></pre>
  
  <p>This prints the following:</p>
  
  <p>Timezone = Europe/Dublin</p>
  
  <p>Date : 2011-10-29 Timestamp : 1319842800 Formatted ('Y-m-d Z T'): 2011-10-29 3600 IST</p>
  
  <p>Result of date('I',timestamp) : 1</p>
  
  <p>Date : 2011-10-30 Timestamp : 1319929200 Formatted ('Y-m-d Z T'): 2011-10-30 3600 IST</p>
  
  <p>Result of date('I',timestamp) : 1</p>
  
  <p>Date : 2011-10-31 Timestamp : 1320019200 Formatted ('Y-m-d Z T'): 2011-10-31 0 GMT</p>
  
  <p>Result of date('I',timestamp) : 0</p>
  
  <p>Date : 2011-11-01 Timestamp : 1320105600 Formatted ('Y-m-d Z T'): 2011-11-01 0 GMT</p>
  
  <p>Result of date('I',timestamp) : 0</p>