Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php date diff in days

$earlier = new DateTime("2010-07-06");
$later = new DateTime("2010-07-09");

$pos_diff = $earlier->diff($later)->format("%r%a"); //3
$neg_diff = $later->diff($earlier)->format("%r%a"); //-3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #date #diff #days
ADD COMMENT
Topic
Name
9+8 =