lewis4u lewis4u - 11 months ago 72
PHP Question

Carbon::now() - only month

I couldn't find anywhere in http://carbon.nesbot.com/docs/ how to show current year or month with Carbon?

when i write this:


it gives me the whole time stamp, but I just need the month



but it must be Carbon!

How can I achieve this?

Answer Source
$now = Carbon::now();
echo $now->year;
echo $now->month;
echo $now->weekOfYear;