Finding the number of days between two dates

后端 未结 30 2548
心在旅途
心在旅途 2020-11-21 23:47

How to find number of days between two dates using PHP?

30条回答
  •  我寻月下人不归
    2020-11-22 00:08

    $datediff = floor(strtotime($date1)/(60*60*24)) - floor(strtotime($date2)/(60*60*24));
    

    and, if needed:

    $datediff=abs($datediff);
    

提交回复
热议问题