Home >Database >Mysql Tutorial >How to convert a string into formatted date and time in MySQL
STR_TO_DATE(date, format): Convert a string into a date and time in format format
SELECT STR_TO_DATE(‘2015-01-01', ‘%Y-%m-%d')
-> 2015-01-01
The above is the detailed content of How to convert a string into formatted date and time in MySQL. For more information, please follow other related articles on the PHP Chinese website!