dt = "2021-11-02T07:47:22.000Z"utc_date = datetime.datetime.strptime(dt, "%Y-%m-%dT%H:%M:%S.000Z")local_date = utc_date + datetime.timedelta(hours=8) // 此时已经转换成功了,成为了日期格式,而且时间也正确了local_date_str = datetime.datetime.strftime(local_date ,'%Y-%m-%d %H:%M:%S')print(dt)print("-------------------------------")print(local_date_str)print("-------------------------------")
