Reputation: 3391
I want to convert a field that represents a date-time but is currently a VARCHAR to a DATETIME field. Currently the representation looks like: 'Sun May 20 01:04:39 +0000 2012' I want to do this operation in a query.
Upvotes: 0
Views: 81
Reputation: 263733
Use STR_TO_DATE
SELECT STR_TO_DATE('Sun May 20 01:04:39 +0000 2012', '%a %M %d %H:%i:%S +0000 %Y')
Upvotes: 4