Gui*_*her 4 python iso mongodb pymongo
使用Python,有没有办法检查dateMongoDB集合中文档的字段是ISO格式还是字符串格式?
date
Bur*_*mir 12
您可以使用库fromisoformat中的方法datetime。
fromisoformat
datetime
from datetime import date try: date.fromisoformat(date_string) except ValueError: print("Invalid isoformat string")
归档时间:
7 年,11 月 前
查看次数:
10325 次
最近记录:
5 年,8 月 前