title: php add hours to date output wrong result
body: <p>Basically what I want to do is to send an email to follow up on order placed in 3 hours later.</p>
  
  <p>What I try to do is to get the current date (up to hours level), then compare with the orderdate+ 3 hours, to see whether it match.</p>
  
  <p>Example orderdate: 2010-06-12 18, after add 3 hours should become 2010-06-12 21</p>
  
  <p>However, after add hour, the final result sometimes become bigger, sometimes become smaller... something wrong.</p>
  
  <pre><code>$now= date('Y-m-d H');
  echo $now . "&lt;br&gt;";
  
  
  ...
  ...
  
  while ($data = mysql_fetch_array ($result))
  {
   $orderid = $data['orderid'];
   $orddate = $data['orddate'];
   $corddate= date('Y-m-d H:i:s', $orddate);
  
  
   $year = substr ($corddate, 0, 4);
   $month = substr ($corddate, 5, 2);
   $day = substr ($corddate, 8, 2);
   $hour = substr ($corddate, 11, 2);
   $actualorderdate= $year . "-" . $month . "-" . $day . " " . $hour;
  
  
   $new_time = mktime ($hour+3, 0, 0, $month, $day, $year);
   $year = date ('Y', $new_time);
   $month = date ('m', $new_time);
   $day=  date ('d', $new_time);
   $hour=  date ('h', $new_time);
   $xhourslater= $year . "-" . $month . "-" . $day . " " . $hour;
  
  
   echo "actualorderdate: ". $actualorderdate. " xhourslater: " . $xhourslater. "&lt;br&gt;";
  
   if($now==$xhourslater)
   {
    echo "now is 3 hours later" . "&lt;br&gt;";
    //send email follow up, then update status as sent, in order not to resend anytime in the 3rd hour.
  
   }
  
  
  }
  </code></pre>