Finding the number of days between two dates

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

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

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

    You can try the code below:

    $dt1 = strtotime("2019-12-12"); //Enter your first date
    $dt2 = strtotime("12-12-2020"); //Enter your second date
    echo abs(($dt1 - $dt2) / (60 * 60 * 24));
    

提交回复
热议问题