One hour difference, but only for some dates

江枫思渺然 提交于 2019-12-04 06:51:15

问题


Why between those dates I get 5,9.... and if I use another year I get 6 ???? It only happens with March and 2008... why is there an hour difference ???

<?php
 $from = '2008-03-04';
 $to = '2008-03-10';

 echo datediff($from,$to);

 $from = '2010-03-04';
 $to = '2010-03-10';

 echo datediff($from,$to);

 function datediff($from,$to)
 {
  $diff = strtotime($to) - strtotime($from);
  $diff = $diff/(60*60*24);
  return $diff;
 }
?>

回答1:


Daylight Saving Time.



来源:https://stackoverflow.com/questions/2233666/one-hour-difference-but-only-for-some-dates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!