Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 mongo db 中插入一些 BC 日期,但我无法创建带有负值的日期时间datetime.datetime(-2000, 2, 1),但在 mongodb 中可以使用 IsoDate,那么如何在 python 中创建负日期?我目前正在使用 python 2.7,我是故意为这个项目做的。
datetime.datetime(-2000, 2, 1)
Python 2.7 的日期时间库只能处理 AD 日期。如果您需要更进一步,您将不得不查看其他库,例如Astropy或datautil中的Time类。 date
Time
date