时间 '2018-08-06T10:00:00.000Z' 格式转化为本地时间(转)

 原文:https://blog.csdn.net/sxf_123456/article/details/81582964

from datetime import datetime,timedelta

#bucket['key_as_string']= '2018-08-06T10:00:00.000Z' 

date_ = datetime.strptime(bucket['key_as_string'],"%Y-%m-%dT%H:%M:%S.%fZ")

#local_time = 2018-08-06 18:00:00

local_time = date_ + timedelta(hours=8)

posted @ 2019-06-11 09:00  心媛意码  阅读(394)  评论(0编辑  收藏  举报