View Single Post
Old 05-28-2008, 10:43 PM   #9 (permalink)
delayedinsanity
The Gregarious
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
delayedinsanity is on a distinguished road
Default

Wildhoney, I apologize in advance if stealing.. er, borrowing your code is in any way offensive, but just for clarity's sake;


PHP Code:
function dateDiff ($iStartDate$iEndDate) {
    return 
sprintf('%d', (strtotime($iEndDate) - strtotime($iStartDate)) / 86400);
}

$iDiff dateDiff('2008-05-29''2008-06-01');
echo 
"Distance between two dates is {$iDiff} days."
now you have a function that does it. If it's not built in, but you know how to do it (or somebody shows you), you can make a function and use it as much as you like.
-m
delayedinsanity is offline  
Reply With Quote