时间单位转化
# coding:utf-8 import datetime utc_time = datetime.datetime.utcnow() # 北京时间(东八区) bj_time = (datetime.datetime.utcnow() + datetime.timedelta(hours=8)) # 美国密西根时间(西五区) us_time = (datetime.datetime.utcnow() - datetime.timedelta(hours=5)) print bj_time.strftime("%Y-%m-%d %H:%M:%S") print us_time.strftime("%Y-%m-%d %H:%M:%S")
kingrain送给读者的话:Everthing isn't getting along well,your efforts paid off!