Answers for "laravel carbon get 1 month from now date"

PHP
3

laravel carbon get year number

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
Posted by: Guest on July-07-2021
5

laravel carbon get month number

use Carbon\Carbon;
// Date = 7th of July 2021
$month = Carbon::now()->format('M'); // July
$month = Carbon::now()->format('m'); // 07
$month = Carbon::now()->month; // 7
Posted by: Guest on July-07-2021
1

laravel carbon get day name

use Carbon\Carbon;

Carbon::now()->format("l") // today's day name. example: Sunday
Posted by: Guest on October-20-2021

Browse Popular Code Answers by Language