Following is the necessary code from file "/xyz/pqr/prj_name/functions/common.php
"
function format_date_yyyy_mm_dd($date_val) {
$date = DateTime::createFromFormat('n-j-Y', $date_val);
return $date->format('Y-m-d'); //Thie is line no.865 where I'm getting the error.
}
This file has been included into the file where the function format_date_yyyy_mm_dd()
is called.
The code for calling the function is as follows :
$form_data['reg_date'] = format_date_yyyy_mm_dd($form_data['reg_date']);
Can some one please help in correcting the code I've written and help me where my code is going wrong?
Thanks in advance.