I want to convert my german localized string like “31.12.2008” into a datatype well known date format. The result should an ISO-formatted value in the style “2008-12-31” and reusable for the database language.
It should be also available in database speech to get control over it in the type specific functionality.
You have to use the mysql database function STR_TO_DATE():
SELECT STR_TO_DATE('31.12.2008', '%d.%m.%Y')
So its also usable for other formats like the american localized format:
SELECT STR_TO_DATE('01/31/2008', '%m/%d/%Y')
After running this on any field in your MySQL-database you are able to use db-functions to sort or search related on the containig date.