How to extract month, day from created_at column in Laravel?

Viewed 62203

I want to display something like 01 June from created_at column. I tried doing something like this which I know, is quite dumb thing.

<span class="day">{{date('m', $new->created_at)}}</span>
6 Answers

You can use Carbon for that. For example, you want to get day from date, then you can follow below code ;

Carbon::parse($data->created_at)->format('l');

This will respond to you as day name.

Related