1

I've got a Twitter database and some columns in multiple tables are time-stamps like:

Tue Sep 09 23:48:37 +0000 2014

These columns are TEXT so I want to convert them. I read Date and Time Types, DATE_FORMAT, and STR_TO_DATE. It seems like that there's no symbol to recognize the timezone pattern, and I can't ignore it because it's not at the end of the string therefore STR_TO_DATE can't leave it there.

Is there some function or walk-around to deal with this problem? Thanks a lot!

2
  • 1
    Is the timezone always +0000 or does it have different values? You can use constants in the format string sqlfiddle.com/#!9/9eecb7d/21046
    – jkavalik
    Sep 17 '15 at 8:16
  • @jkavalik nice shot! In my data it's always +0000, I'll give it a try. Thanks!
    – leoce
    Sep 19 '15 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.