python中UTC时间转换本地时间

import datetime

timenow = (datetime.datetime.utcnow() + datetime.timedelta(hours=8))

timetext = timenow.strftime('%Y%m%d')

#打印查看的话,输出一下代码:
print(timetext)

  

猜你喜欢

转载自www.cnblogs.com/lily-20141202/p/10374377.html
0条评论
添加一条新回复