How to get time difference in minutes in PHP

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

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

17条回答
  •  日久生厌
    2020-11-21 08:08

    It worked on my programs, i'am using date_diff, you can check date_diff manual on here.

    $start = date_create('2015-01-26 12:01:00');
    $end = date_create('2015-01-26 13:15:00');
    $diff=date_diff($end,$start);
    print_r($diff);
    

    You get results what do you want.

提交回复
热议问题