使用第三方库中的parser模块,将时间转换成ISODate类型#!/usr/bin/python import pymongo from dateutil import parsert1 = "2019-12-30T09:57:39.308+0000"starttime = parser.parse(t1)