I am receiving twitter messages that are sent at a certain date in the following format from twitter:
Tue Mar 29 08:11:25 +0000 2011
I want
The initial problem I was having was converting from the datetime that the twitter api gives to String.
The following works which addresses different comments people seem to have for above solutions which are a little unclear as to whether the starting date is already in string format or not. This works for Python 2.7
With a tweet from the API, tweet.created_at gives the date in datetime format. At the top of your file, add from datetime import datetime
then use the following to get the corresponding string.
datetime.strftime(tweet.created_at,'%a %b %d %H:%M:%S %z %Y').
You can then use this string as described in other comments to manipulate it.