So, i have this format date :
2014-16-02 08:00:00 PM
YYYY-DD-MM HH:MM:SS AM/PM Format
Years - Days - Months
What is the best way to convert this to
2014-02-16 20:00:00
Without the AM/PM and with the month before the days.
I already tried it with the DateTime function from PHP :
// $date = new \DateTime($row[0]);
// $date_formatted = $date->format('Y-m-d H:i:s');
But this is not working because Datetime recognises the days as months because of this format YYYY-DD-MM
How to do this in PHP