123456789101112131415161718 |
- 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)
- # dtimeArray = time.strftime(nowutc)
- # utc转换时间
- timenow = (datetime.datetime.utcnow() + datetime.timedelta(hours=8))
- print(timenow)
|