laravel blade date format
//laravel method 1
{{ $data->created_at->isoFormat('dddd D') }}
//laravel method 2
{!! date('d/M/y', strtotime($data->created_at)) !!}
laravel blade date format
//laravel method 1
{{ $data->created_at->isoFormat('dddd D') }}
//laravel method 2
{!! date('d/M/y', strtotime($data->created_at)) !!}
date format change in laravel blade
{{date_format($data->con_date_maintained,'D M Y')}}
{{ $data->con_wash_start_date == null ? date_format($data->con_date_maintained,'D M Y') : "-" }}
//$uj@y
laravel set date format
{{ $post->created_at->diffForHumans() }}
/*
//Output
Arya Stuck 14 minutes ago
Post something
Mizan Khan 23 hours ago
Post something
*/
blade format date
{!! htmlspecialchars_decode(date('j<\s\up>S</\s\up> F Y', strtotime('21-05-2020'))) !!}
change the date format in laravel view page
// date('d-m-Y', strtotime($user->from_date));
public function convertDate($date,$format = 'd-m-Y'){
return date($format, strtotime($date));
}
or
public function convertDate($date,$format = 'd/m/Y'){
return \Carbon\Carbon::parse($date)->format($format);
}
$user->convertDate($user->from_date);
//$user->convertDate($user->from_date,'Y-m-d'); with format
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us