20 lines
396 B
PHP
20 lines
396 B
PHP
<?php
|
|
namespace App\Tools;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class Times
|
|
{
|
|
//获取当前时间
|
|
public static function getNowDateTime(string $format = 'Y-m-d H:i:s'): string
|
|
{
|
|
return date($format);
|
|
}
|
|
|
|
public static function getNowDateTimeAddDays(int $days, string $format = 'Y-m-d'): string
|
|
{
|
|
return Carbon::now()->addDays($days)->format($format);
|
|
}
|
|
|
|
}
|