0

I need some help with this. I have database with a column for start and end with a value format Fri Feb 21 2014 00:00:00 GMT+0800 (Malay Peninsula Standard Time) an store in varchar. I want to convert it to date in MySQL query.

I've tried using str_to_date() but there is no luck.

Please help me!

1 Answer 1

1
SELECT STR_TO_DATE('Fri Feb 21 2014 00:00:00 GMT+0800 (Malay Peninsula Standard Time)','%a %M %e %Y %H:%i:%s');
+---------------------------------------------------------------------------------------------------------+
| STR_TO_DATE('Fri Feb 21 2014 00:00:00 GMT+0800 (Malay Peninsula Standard Time)','%a %M %e %Y %H:%i:%s') |
+---------------------------------------------------------------------------------------------------------+
| 2014-02-21 00:00:00                                                                                     |
+---------------------------------------------------------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
Sign up to request clarification or add additional context in comments.

2 Comments

I've tried that one but using this Fri Feb 21 2014 00:00:00 GMT+0800 (Malay Peninsula Standard Time). no luck.
Working for that string too. Updated my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.