laravel blade display date format code example

Example 1: format date laravel timestamp view

date('d-m-Y', strtotime($user->from_date));
/**
or
**/
date_format($user->from_date,'D M Y')

Example 2: format date laravel timestamp view

date('d-m-Y', strtotime($user->from_date));

Example 3: blade format date

{!! htmlspecialchars_decode(date('j<\s\up>S</\s\up> F Y', strtotime('21-05-2020'))) !!}

Example 4: laravel blade date format

//laravel method 1
{{ $data->created_at->isoFormat('dddd D') }}

//laravel method 2 
{!! date('d/M/y', strtotime($data->created_at)) !!}

Tags:

Php Example