Page 1 of 1

date

Posted: Wed Aug 15, 2007 7:56 am
by m2babaey
Hi
I want to calcaulate how many, days is between 2010-1-10 and 1999-11-1
Ho can i do that?

Posted: Wed Aug 15, 2007 8:03 am
by miro_igov

Code: Select all

$from = strtotime('1999-11-1');
$to = strtotime('2010-1-10');

$seconds = $to - $from;

$days = $seconds / 60*60*24;

echo $days;
This will not work for dates before 1970.

Posted: Wed Aug 15, 2007 8:40 am
by feyd
We've had several topics on this recently. There's also a Code Snippet about this. What results have you found from searching?