时间 '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)

转载于:https://www.cnblogs.com/Stephen-Qin/p/11001743.html

你可能感兴趣的:(时间 '2018-08-06T10:00:00.000Z' 格式转化为本地时间(转))