How to get time difference in minutes in PHP

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

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

17条回答
  •  忘掉有多难
    2020-11-21 07:56

    $date1=date_create("2020-03-15");
    $date2=date_create("2020-12-12");
    $diff=date_diff($date1,$date2);
    echo $diff->format("%R%a days");
    

    For detailed format specifiers, visit the link.

提交回复
热议问题