我必须在PHP中使用2个日期值,
start_date_time = "2018-03-15T20:39:06Z"
end_date_time = "2018-03-17T12:42:08Z"
duration = ? // in seconds
我实际上想要以秒为单位获得总时间。请帮忙
答案 0 :(得分:0)
$start_date_time = strtotime('2011-05-12 18:20:20');
$end_date_time = strtotime('2011-05-13 18:20:20');
$durationeInSeconds = $start_date_time - $end_date_time;