Parse date in MySQL
问题 How to convert the following into date for insertion/update into a TIMESTAMP or DATE field in MySQL? \'15-Dec-09\' DATE_FORMAT() is used to format date, but not the other way around. 回答1: You may want to use the STR_TO_DATE() function. It's the inverse of the DATE_FORMAT() function. STR_TO_DATE(str,format) This is the inverse of the DATE_FORMAT() function. It takes a string str and a format string format . STR_TO_DATE() returns a DATETIME value if the format string contains both date and time