Create an ISODate with pyMongo

前端 未结 4 1712
春和景丽
春和景丽 2020-12-01 06:22

I\'ve been trying to find a way to create an ISODate object whith pyMongo client, but without any success so far.

I use http://pypi.python.org/pypi/pymongo3 client,

4条回答
  •  一整个雨季
    2020-12-01 06:45

    result = db.objects.insert_one(
       {"last_modified": datetime.datetime.utcnow()})
    

    Here utc stands for Universal Time Coordinates.

提交回复
热议问题