Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel carbon get year number

use CarbonCarbon;
// Date = 7th of July 2021
$year = Carbon::now()->format('Y'); // 2021
$year = Carbon::now()->format('y'); // 21
$year = Carbon::now()->year; // 2021
 
PREVIOUS NEXT
Tagged: #laravel #carbon #year #number
ADD COMMENT
Topic
Name
3+6 =