I am trying to format the date in MySQL but I do not get it, the format of the date is as follows:
08-05-2017 - 18:03
I want to transform it to
2018-11-09 - 20:30
Using
SELECT DATE_FORMAT(STR_TO_DATE(fecha, '%d-%m-%Y - %H:%i'), '%Y-%m-%d -
%H:%i') WHERE id = 92
Am I using STR_TO_DATE and DATE_FORMAT correctly?
Thanks
Edito: Correct, missing the FROM silly mistake that I did not realize, then to update I used the UPDATE and that's it, thank you very much to everyone
UPDATE tabla SET fecha = DATE_FORMAT(STR_TO_DATE(fecha, '%d-%m-%Y %H:%i'), '%Y-%m-%d - %H:%i') WHERE id = ?