📜  带有分钟碳的diffinhours - PHP代码示例

📅  最后修改于: 2022-03-11 14:54:26.831000             🧑  作者: Mango

代码示例1
$start = new Carbon('2021-01-01 00:00:00');
$end = new Carbon('2021-01-01 07:26:00');

// One line solution
$start->diff($end)->format('%H:%I:%S'); // 07:26:00

// OR
$totalDuration = $end->diffInSeconds($start); // 21
gmdate('H:i:s', $totalDuration); // 07:26:00