[eluser]taewoo[/eluser]
So I have this code
Code:
<?php
function dateDiff($start, $end)
{
$start_ts = strtotime($start);
$end_ts = strtotime($end);
$diff = $end_ts - $start_ts;
return $diff;
}
echo dateDiff("2006-04-01 6:00 PM", "2006-04-02 6:00 AM"); // this prints 39600, incorrect
echo dateDiff("2009-04-01 6:00 PM", "2009-04-02 6:00 AM"); // this prints 43200, correct
?>
I am going insane... i can't figure out WHY. There are 86400 seconds in a day (unless of course, April of 2006 had some crazy time warp going on...
ANyone know why?