2022-03-23T08:40:10.895Z 这样的UTC时间格式转化为北京时间
from datetime import datetime, timedelta push_time = '2022-03-23T08:40:10.895Z' push_time1 = datetime.strptime(push_time[0:-5], "%Y-%m-%dT%H:%M:%S") + timedelta(hours=8) print(push_time1) push_time2 = datetime.strptime(push_time, "%Y-%m-%dT%H:%M:%S.%fZ") + timedelta(hours=8) print(push_time2)
2022-03-23 16:40:10
2022-03-23 16:40:10.895000