📜  laravel subdays - PHP 代码示例

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

代码示例3
$start_time = \Carbon\Carbon::parse($request->input('start_time'));
$finish_time = \Carbon\Carbon::parse($request->input('finish_time'));

$price = $request->input('price');

$result = $start_time->diffInDays($finish_time, false);

if ($result < 0) {
  $price = $price * $result;
}