lewis4u lewis4u - 1 year ago 97
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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download