Mysql how to convert string to datetime format

I am using 01/04/2016 this type of format. How can i convert string to datetime format.

Answer

The STR_TO_DATE() converts the str string into a date value

Syntax:
STR_TO_DATE(str,fmt);

Examples:
select str_to_date("03/02/2009","%d/%m/%Y");

RESULT:

Post a Comment

0 Comments