Hello,
I have two dates eg:
$date1 = "2005-08-02 22:28:55"; $date2 = "2005-09-02 12:15:00";
Is there a way i can subtract one from the other to give me the number of days in between? Because i have the time in there as well it is proving more difficult than once thought.
Thanks
$date1 = strtotime("2005-08-02 22:28:55"); $date2 = strtotime("2005-09-02 12:15:00"); $days = ($date2 - $date1) / (60*60*24);
That's the general idea. You'll probably want to round, floor, or ceil the result.