Created
July 22, 2015 08:25
-
-
Save revox/2ad8354c96706fa7346f to your computer and use it in GitHub Desktop.
Convert tweet dates into MySQL dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Tweet dates look like this Tue Apr 21 18:07:47 +0000 2015 */ | |
/* test */ | |
SELECT STR_TO_DATE('Tue Apr 21 18:07:47 +0000 2015', '%a %b %d %H:%i:%s +0000 %Y'); | |
/* import stringdate into fake date column which has type VARCHAR, then add a DATETIME column and the do this */ | |
UPDATE tweets SET tweetdate = STR_TO_DATE(fake, '%a %b %d %H:%i:%s +0000 %Y'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment