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
Post a Comment