Ok guys, I hope someone here can help me.
I got a bunch of XML files I have to import with this time format:
20100712 17:51:03
And according to the MYSQL docs, the correct DATETIME format is:
'YYYY-MM-DD HH:MM:SS'
As you can see, the only thing that is ruining the show for me is those hyphens between the year, month and date.
Would anyone know of a good tip to try to adapt this format to MYSQL’s? I already tried importing it just like it is and MYSQL changes the date to 00-00-00 00:00:00 because it’s in an invalid format.
Try STR_TO_DATE:
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date