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.
似乎 python 日期的最小年份是 1。如果我想要 0 或 -1 或更少,例如,如果我编写一个关于恐龙的程序。我应该怎么办?PS tbh,我不关心恐龙,我只想要0年,有什么解决方法吗?
不,那里没有。
请注意,datetime 模块实现了没有年份 0 的公历(首次引入 1582)。它也没有考虑整个历史中的日历重新排列,因此无论如何您都无法准确跟踪几个世纪以来的日期。