1000年(和其他年份)是闰年吗?

2024-06-01 07:02:24 发布

您现在位置:Python中文网/ 问答频道 /正文

如果Y完全可被4整除,则年份Y是闰年,并且

  • 不是100,或者
  • 100到400

以下来源遵循上述规则:

然而,以下消息来源称1000年是闰年:

格里高利体系是在1582引入的,上面的规则显然开始适用(1582年以前,唯一的要求是完美除以4)。然而,测试其他年份的值(100、500、600、700、900、1100、1300、1400、1500和1700)表明,只有在1800年(包括1800年)之后,PythonLinux-cal的结果才一致。在

为什么这些来源给出了不同的答案?在


Tags: 答案命令com规则linux来源calendarcal
1条回答
网友
1楼 · 发布于 2024-06-01 07:02:24

calendar模块使用公历。在

来自the ^{} docs

Most of these functions and classes rely on the datetime module which uses an idealized calendar, the current Gregorian calendar extended in both directions. This matches the definition of the “proleptic Gregorian” calendar in Dershowitz and Reingold’s book “Calendrical Calculations”, where it’s the base calendar for all computations.

Wikipedia

The proleptic Gregorian calendar is produced by extending the Gregorian calendar backward to dates preceding its official introduction in 1582.

儒略历并没有被公历取代。它在不同的时期被各国采用。在

从我(相当古老)机器上的Linux cal手册页:

-s -file ... -country_code

Assume the switch from Julian to Gregorian Calendar at the date associated with the country_code If not specified, ncal tries to guess the switch date from the local environment or falls back to September 2, 1752. This was when Great Britain and her colonies switched to the Gregorian Calendar.

[...]

BUGS

The assignment of Julian–Gregorian switching dates to country codes is historically naive for many countries.

相关问题 更多 >