Converting strings to dates in MySQL

Use the str_to_date function and provide the format you need to it. for example, if you have a field called created_dttm with a date which is in the format “24-07-2015 06:00:00” you can use this to convert into a MySQL date so that you use various MySQL date functions on it.

select str_to_date(created_dttm, '%d-%M-%Y %H:%i%s');

See this list for all the date formats.