$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)."<br/>";
echo date('Y/m/d H:i:s', $new_time)."<br/>";
echo date('H', $diff);
输出:
2013/09/03 09:25:52
2013/09/03 10:25:52
02 //which should be 1
为什么 $diff 总是与正确答案相差 1?