I am trying to convert a date format from 31/12/15 to 2015-12-31 but I am having problems with this, I have tried strtotime
methods with no luck as I keep getting 2031-12-15.
I have now changed the method to this:
$csv_array[4] = '31/12/15';
$insert_csv['custom_10'] = DateTime::createFromFormat('d/m/y', $csv_array[4])->format('Y-m-d');
which seems to be echoing the correct format but also throwing an error of:
Fatal error: Call to a member function format() on a non-object