Finding the number of days between two dates

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

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

30条回答
  •  隐瞒了意图╮
    2020-11-22 00:16

    Easiest way to find the days difference between two dates

    $date1 = strtotime("2019-05-25"); 
    $date2 = strtotime("2010-06-23");
    
    $date_difference = $date2 - $date1;
    
    $result =  round( $date_difference / (60 * 60 * 24) );
    
    echo $result;
    

提交回复
热议问题