How To Calculate The Number Of Days Between Dates In PHP
erics, November 9th, 2011
1 2 3 4 5 |
date_default_timezone_set('America/New_York'); $datetime1 = new DateTime('2009-10-31'); $datetime2 = new DateTime('now'); $interval = $datetime1->diff($datetime2); print $interval->format('%a days_elapsed'); |
http://www.php.net/manual/en/datetime.diff.php