简体   繁体   English

python datetime.date可能的最小年份

[英]python datetime.date minimal year possible

It seems that minimal year possible for python's date is 1. What if I want 0 or -1 or less eg if I write a program about dinosaurs. 似乎python的日期的最小年份可能是1。如果我想要0或-1或更少,例如编写有关恐龙的程序,该怎么办。 What should I do? 我该怎么办? PS tbh, I don't care about dinosaurs, I only want year 0, is there any workaround? PS tbh,我不在乎恐龙,我只想要0年,有什么解决方法吗?

No, there is not. 不,那里没有。

Note that the datetime module implements the Gregorian calendar (first introduced 1582) which does not have a year 0. It does not take into account calendar rearrangements throughout history either, so you cannot track dates accurately over centuries time anyway. 需要注意的是datetime模块实现了公历 (首次引入1582年),其不具有 0年它没有考虑到历史上的帐户日历重排要么,所以你不能在几个世纪的时间准确地跟踪日期反正。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM