twitter api取出的日期格式化

import pickle
import datetime
crate_time_list=[]
twitter_id_list=[]
twitter_url_list=[]
twitter_text_list=[]
print(datetime.datetime)
with open("status(0)","rb") as f:
    s=pickle.load(f)
jsonstr=s._json
create_time=jsonstr.get("created_at")
print(datetime.datetime.strptime(create_time,"%a %b %d %H:%M:%S +0000 %Y"))
twitter_id_list=jsonstr.get("id")
twitter_text_list=jsonstr.get("text")

  带转换字符串Thu Mar 22 05:33:41 +0000 2018,格式化字符串"%a %b %d %H:%M:%S +0000 %Y"

posted @ 2018-03-22 15:00  公众号python学习开发  阅读(225)  评论(0编辑  收藏  举报