I want to change the date format which is fetched from database. now I got 2016-10-01{{$user->from_date}} .I want to change the format \'d-m-y\' in laravel
{{$user->from_date}}
Sometimes changing the date format doesn't work properly, especially in Laravel. So in that case, it's better to use:
$date1 = strtr($_REQUEST['date'], '/', '-'); echo date('Y-m-d', strtotime($date1));
Then you can avoid error like "1970-01-01"!