Format Tanggal Laravel Timestamp View
date('d-m-Y', strtotime($user->from_date));
/**
or
**/
date_format($user->from_date,'D M Y')
Bug Killer
date('d-m-Y', strtotime($user->from_date));
/**
or
**/
date_format($user->from_date,'D M Y')
//
$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
{{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
date('d-m-Y', strtotime($user->from_date));
// 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