新款导入节目单,自动匹配时间(需提前导入分P信息)

This commit is contained in:
2022-08-24 20:54:34 +08:00
parent 00acb688c5
commit 5cbf9ff177
6 changed files with 105 additions and 40 deletions

19
app/Util/TimeUtil.php Normal file
View File

@ -0,0 +1,19 @@
<?php
namespace App\Util;
use Carbon\Carbon;
class TimeUtil
{
public static function calculate_program_time(Carbon $base_time, int $seconds, int $bias = 0): Carbon
{
$time = $base_time->copy()->addSeconds($seconds)->addSeconds($bias);
if ($time->second > 30) {
$time->addMinute();
}
$time->seconds(0);
return $time;
}
}