Return to Snippet

Revision: 25952
at April 14, 2010 16:52 by gfazioli


Initial Code
// Calculate the difference from two date in days
$diff = (strtotime("2010-04-26") - strtotime("2010-02-05")) / 86400;

// To format now, for example, use date('Y-m-dì);
$diff = (strtotime( date('Y-m-d') ) - strtotime("2010-02-05")) / 86400;

Initial URL
http://www.undolog.com

Initial Description
Calculate the difference from two date in days

Initial Title
Date Difference in Days with PHP

Initial Tags
php, date

Initial Language
PHP