php - Subtract one DateTime from another and return days -


i have 2 datetime objects. 1 represents 2 days , other represents 2 days , 6 months now.

i need able count number of days between these 2 dates display users dates can book on.

i have calculated 2 dates struggling finding way subtract them , return difference in days.

$first; // first datetime object  $second; // second datetime object   $diff = $first->diff($second);  echo $diff->days; 

also take @ dateinterval class @ php.net


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -