-1

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;
 }
?>
Gmi182
  • 41
  • 6
  • My guess would be PHP, considering that's the only common language I know with `strtotime` as a std. library function. – Amber Feb 10 '10 at 00:55

1 Answers1

3

Daylight Saving Time.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358