import time tmstm = '2018121810' timeArray = time.strptime(tmstm,"%Y%m%d%H") print(timeArray) print(int(time.mktime(timeArray))) import datetime # utc时间 nowutc = (datetime.datetime.utcnow()) print(nowutc) # utc转换时间 timenow = (datetime.datetime.utcnow() + datetime.timedelta(hours=8)) print(timenow)