import time
a = "Tue Apr 22 21:05:23 0800 2014"
b = a.repacle(" 0800 ","")#去掉时区
c = time.strptime(b,"%Y-%m-%d %H:%M:%S")#转换为时间元组
d = time.strftime("%Y-%m-%d %H:%M:%S",c) #转换成需求格式
结果
d = '2014-04-22 21:05:23'
import time
a = "Tue Apr 22 21:05:23 0800 2014"
b = a.repacle(" 0800 ","")#去掉时区
c = time.strptime(b,"%Y-%m-%d %H:%M:%S")#转换为时间元组
d = time.strftime("%Y-%m-%d %H:%M:%S",c) #转换成需求格式
结果
d = '2014-04-22 21:05:23'