Avatar of EICT
EICT
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Converting Date (d-m-Y_His) stored in mysql VARCHAR to mysql DATETIME

Hi,
I was trying to sort records in one of our MySQL databases by date but I notice that the date values are stored as VARCHAR data type rather than a DATETIME value.

i.e.  08-07-2016_164533     in the format d-m-Y_His  (day-month-Year_HourMinuteSecond)

I wonder if there is an easy way to convert these values to DATETIME datatype for easier manipulation?

Thanks
DatabasesMySQL ServerMongoDB

Avatar of undefined
Last Comment
skullnobrains

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
chaau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
skullnobrains

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck