date calculations giving wrong results
Posted: Wed Apr 02, 2008 9:57 am
Hello.
Using this code, why i'm having diferent results with this code ?
Results:
what i'm missing here ?
Using this code, why i'm having diferent results with this code ?
Code: Select all
$day = 60*60*24;
$status = 'Wed Aug 11 13:03:20 WEST 2010';
$expire_date = date("d/m/Y", strtotime($status));
var_dump($expire_date);
$expiration_date = strtotime($expire_date);
$today = date("d/m/Y");
var_dump($today);
var_dump( ($expiration_date-strtotime($today))/$day );
$today = date("d/m/Y", strtotime('now'));
var_dump( ($expiration_date-strtotime($today))/$day );
$today = strtotime('2 April 2008');
$august_11_2010 = strtotime('11 August 2010');
var_dump( ($august_11_2010-$today)/$day);
Results:
Code: Select all
string(10) "11/08/2010"
string(10) "02/04/2008"
int(1008)
int(1008)
int(861)