Answers for "Laravel change date format in controller"

PHP
0

date format change in laravel

//
$editData->hld_end_date ? date('d-m-Y',strtotime($editData->hld_end_date)) : null // bydefault null

date('d-m-Y',strtotime(str_replace('/', '-', $editData->hld_end_date) //bydefault value is null then 01-01-1970
                       
date_format(date_create($editData->hld_end_date),'d-m-Y') //bydefault value is null then Today date
                       
$editData->hld_end_date->format('d-m-Y') // null error
                       
\Carbon\Carbon::parse($editData->hld_end_date)->format('d/m/Y') //bydefault value is null then 01-01-1970
//$uj@y
Posted by: Guest on May-18-2021
-1

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
Posted by: Guest on November-23-2020
0

laravel set date format

{{ $post->created_at->diffForHumans() }}
  /*
  	//Output
  Arya Stuck 14 minutes ago
  Post something 
  
  Mizan Khan 23 hours ago
  Post something
  */
Posted by: Guest on July-20-2021

Code answers related to "Laravel change date format in controller"

Browse Popular Code Answers by Language