This is weird - Isn't every unix timestamp day exactly 86400 seconds apart?
I compare 2 date timestamps, remove the lesser from the larger, divide that number by 86400 (number of seconds in a single day) and that gives me the exact number of days betwenn the two. as in following code:
In most cases this comes out fine echoing the exact number of days in between. But when I had the later date as 2005-11-21 (timestamp = 1132549200 and the earlier date as 2005-09-21 (timestamp = 1127275200) the days in between come out as 61.04166666666666! Running the numbers thru a simple calculater I see the same results so where did I go wrong here
I compare 2 date timestamps, remove the lesser from the larger, divide that number by 86400 (number of seconds in a single day) and that gives me the exact number of days betwenn the two. as in following code:
Code:
$retdbdate = ("$return_year-$return_month-$return_day");
//return date now in unixtimestamp
$retunixdate = strtotime($retdbdate);
$actual_retdbdate = ("$actual_return_year-$actual_return_month-$actual_return_day");
//actual return date now in unixtimestamp
$actual_retunixdate = strtotime($actual_retdbdate);
$days_late = ($actual_retunixdate - $retunixdate) /86400;
In most cases this comes out fine echoing the exact number of days in between. But when I had the later date as 2005-11-21 (timestamp = 1132549200 and the earlier date as 2005-09-21 (timestamp = 1127275200) the days in between come out as 61.04166666666666! Running the numbers thru a simple calculater I see the same results so where did I go wrong here