📜  laravel 秒到时分秒 - PHP 代码示例

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

代码示例2
//seconds and human time readable
$endTime = Carbon::parse("2021-09-23 19:15:16");
$startTime = Carbon::parse("2021-09-23 19:15:14");
$timeleft = $startTime->diffForHumans($endTime);
return $timeleft;
//output => time_left: "2 second before"