How to get time difference in minutes in PHP

后端 未结 17 2248
独厮守ぢ
独厮守ぢ 2020-11-21 07:22

How to calculate minute difference between two date-times in PHP?

17条回答
  •  感动是毒
    2020-11-21 07:51

    Here is the answer:

    $to_time = strtotime("2008-12-13 10:42:00");
    $from_time = strtotime("2008-12-13 10:21:00");
    echo round(abs($to_time - $from_time) / 60,2). " minute";
    

提交回复
热议问题