Finding the number of days between two dates

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

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

30条回答
  •  借酒劲吻你
    2020-11-22 00:19

    function howManyDays($startDate,$endDate) {
    
        $date1  = strtotime($startDate." 0:00:00");
        $date2  = strtotime($endDate." 23:59:59");
        $res    =  (int)(($date2-$date1)/86400);        
    
    return $res;
    } 
    

提交回复
热议问题