title: php - why difference between two times always wrong using these methods?
body: <pre><code>$time1 = time();
  $time2 = mktime(date('H')+1, date('i'), date('s'), date('m'), date('d'), date('Y'));
  $diff = $time2 - $time1
  echo date('Y/m/d H:i:s', $time)."&lt;br/&gt;";
  echo date('Y/m/d H:i:s', $new_time)."&lt;br/&gt;";
  echo date('H', $diff);
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>2013/09/03 09:25:52
  2013/09/03 10:25:52
  02 //which should be 1
  </code></pre>
  
  <p>Why is the $diff always different from the correct answer by 1?</p>