📜  laravel carbon 获取年份编号 - PHP 代码示例

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

代码示例1
use Carbon\Carbon;
// Date = 7th of July 2021
$year = Carbon::now()->format('Y'); // 2021
$year = Carbon::now()->format('y'); // 21
$year = Carbon::now()->year; // 2021