use Carbon\Carbon;
use PhpOffice\PhpSpreadsheet\Shared\Date;
...
public static function transformDateTime(string $value, string $format = 'Y-m-d')
{
try {
return Carbon::instance(Date::excelToDateTimeObject($value))->format($format);
} catch (\ErrorException $e) {
return Carbon::createFromFormat($format, $value);
}
}
laravel execl导入时间变数字
最新推荐文章于 2023-11-21 10:18:22 发布