I am using MySQL DATE_FORMAT function to grab the date in the format i need it in. as the following:
SELECT DATE_FORMAT(`dob`, '%m-%d-%Y' ) as dob FROM `tblUsersProfile` WHERE `user_id` = 1
But now i want to update the date from this format to the default mysql date format?
I know how to do this in php, but iam trying to change the format in MySQL. Anyone know?
You want MySQL’s
STR_TO_DATE()function: