Difference between dates [closed]

hotlikeme

New Member
\[quote\] Possible Duplicates:
Difference between dates
How to calculate the date difference between 2 dates using php \[/quote\]So, I have two dates. For instance, \[code\]2010-09-24\[/code\] and \[code\]2010-09-25\[/code\]. I want to check if between those two dates the difference is 1 day. I don't need to get a value of \[code\]86400\[/code\] which means one day in seconds. Don't forget that it can be 28, 28, 29, 30, 31 days in month.Thanks.What I have right now, but it doesn't work when there is difference between months:\[code\]$strto = strtotime($date);$d1 = date('d', $strto);$d2 = date('d', time());echo $d2- $d1;\[/code\]
 
Back
Top