# 末日规则

末日规则是一种心算算法，由英国数学家约翰·霍顿·康威（John Horton Conway）发明，它利用简单的算术和一小串便于记忆的锚定日期，给出格里高利历中任意日期是星期几。<sup>[1](https://www.timeanddate.com/date/doomsday-rule.html)</sup>康威于1973年将其发表在剑桥数学学会“阿基米德学会”（The Archimedeans）的期刊《尤里卡》（Eureka）上，题为《明天是末日之后的那天》（*Tomorrow is the Day After Doomsday*）。<sup>[2](https://simonplantinga.nl/posts/conway-doomsday/)</sup>有资料将发明时间定在1970年，而康威本人发表的记述及大多数参考文献则将其定在1973年。<sup>[1](https://www.timeanddate.com/date/doomsday-rule.html)</sup><sup> • </sup><sup>[2](https://simonplantinga.nl/posts/conway-doomsday/)</sup><sup> • </sup><sup>[3](https://xlinux.nist.gov/dads/HTML/doomsday.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 用途 | 通过心算找出格里高利历任意日期是星期几，无需计算器、电脑或日历<sup>[1](https://www.timeanddate.com/date/doomsday-rule.html)</sup> |
| 起源 | 由约翰·霍顿·康威发明；以《明天是末日之后的那天》为题发表于《尤里卡》第36期，1973年10月<sup>[2](https://simonplantinga.nl/posts/conway-doomsday/)</sup> |
| 末日日期 | 4/4、6/6、8/8、10/10、12/12、5/9、9/5、7/11、11/7、3月7日，以及二月的最后一天，在任意给定年份中都落在同一个星期几<sup>[1](https://www.timeanddate.com/date/doomsday-rule.html)</sup> |
| 逐年漂移 | 末日每平年推进一天，每闰年推进两天，因为365 ≡ 1、366 ≡ 2（模7）<sup>[4](https://people.se.cmich.edu/graha1sw/pub/doomsday/doomsday.pdf)</sup> |
| 世纪锚点 | 1900年是星期三，2000年是星期二，2100年是星期日；完整的日历每400年重复一次<sup>[5](https://www.nanamic.org.uk/app/download/32831492/BCME%2BFinal%2BReport.pdf)</sup> |
| 速度 | 经过练习，几秒钟内即可答出一个日期；康威的电脑用随机日期考他，他通常在两秒内作答<sup>[6](https://www.scientificamerican.com/article/calendar-algorithm/)</sup> |

## “末日”的含义

尽管名字如此，这条规则与世界末日毫无关系。康威发现某些日期在任意给定年份中都共享同一个星期几，并将这个共享的星期几称为该年的“末日”；人们完全可以把它叫作锚定日。共享这一天的日期很容易记住。偶数月贡献了4/4、6/6、8/8、10/10和12/12，即数字重复的日期。奇数月贡献了5/9、9/5、7/11和11/7，通过康威的口诀“朝九晚五在7-Eleven打工”来记忆。二月贡献其最后一天，平年为2月28日，闰年为2月29日，三月则贡献3月7日。<sup>[6](https://www.scientificamerican.com/article/calendar-algorithm/)</sup><sup> • </sup><sup>[6](https://www.scientificamerican.com/article/calendar-algorithm/)</sup><sup> • </sup><sup>[1](https://www.timeanddate.com/date/doomsday-rule.html)</sup>

康威自己的表述将这一模式概括为：一月和二月取“最后一天”，偶数月取第n日，奇数月取第（n ± 4）日，长奇数月（三月、五月、七月）用加号，短奇数月（九月和十一月）用减号。<sup>[2](https://simonplantinga.nl/posts/conway-doomsday/)</sup>知道了一年的末日，实际上就等于对那一年的完整日历了如指掌。<sup>[2](https://simonplantinga.nl/posts/conway-doomsday/)</sup>

## 计算如何进行

**世纪锚点。** 由于格里高利历每400年重复一次，只需记住少数几个世纪锚点：1900至1999年为星期三，2000至2099年为星期二，2100至2199年为星期日。用康威的记号，世纪年100c的末日为\( 2 - 2c_{2} \)模7，其中\( c_{2} \)是世纪数除以4的余数，四种可能的余数分别给出星期二、星期日、星期五和星期三。<sup>[5](https://www.nanamic.org.uk/app/download/32831492/BCME%2BFinal%2BReport.pdf)</sup><sup> • </sup><sup>[7](https://link.springer.com/article/10.1007/s00283-022-10229-3)</sup>

**年份偏移。** 一个365天的平年将给定星期几偏移一天，一个366天的闰年偏移两天，因此每年末日向前移动一天，闰年则移动两天。对于年份\( n = 100c + y \)，末日因此为\( f(n) = (2 - 2c_{2}) + (y + y_{1}) \)模7，其中\( y_{1} = \lfloor y/4 \rfloor \)计算闰年数。BCME会议录中的一个演算示例：对于2035年，取35加上8个闰年，得到从2000年的星期二起漂移43天；43模7为1，所以2035年的末日是星期三。<sup>[4](https://people.se.cmich.edu/graha1sw/pub/doomsday/doomsday.pdf)</sup><sup> • </sup><sup>[7](https://link.springer.com/article/10.1007/s00283-022-10229-3)</sup><sup> • </sup><sup>[5](https://www.nanamic.org.uk/app/download/32831492/BCME%2BFinal%2BReport.pdf)</sup>

**月份和日期。** 最后一步是选取最接近目标的末日日期并数天数。例如，由于1994年9/5是星期一，1994年9月6日就是星期二。康威建议不要计算诸如“24 − 5 = 19 ≡ −2（模7）”这样的差值，而是从附近的末日日期向前数，他说这个习惯可以避免符号错误，并逐渐积累更多记住的末日日期。<sup>[6](https://www.scientificamerican.com/article/calendar-algorithm/)</sup><sup> • </sup><sup>[2](https://simonplantinga.nl/posts/conway-doomsday/)</sup>

## 起源与前身

许多确定日期星期几的规则都早于康威。C. F. 高斯（C. F. Gauss）、C. J. J. 泽勒牧师（C. J. J. Zeller）和刘易斯·卡罗尔（Lewis Carroll）都在19世纪研究过这个问题。卡罗尔于1887年3月31日在《自然》（*Nature*）上发表了其方法，将日期拆分为世纪、年、月、日各项，并各自对7取模；他报告自己的平均用时约为20秒。高斯将1月1日设为其锚定日，而卡罗尔选择了一个虚拟的“3月0日”；每年只有一个锚点，当目标日期远离锚点时计算就变得笨拙。<sup>[8](https://cubo.ufro.cl/index.php/cubo/article/view/1760)</sup><sup> • </sup><sup>[9](https://schnark.github.io/lewis-carroll/html/magazines/to-find-the-day-of-the-week.html)</sup><sup> • </sup><sup>[7](https://link.springer.com/article/10.1007/s00283-022-10229-3)</sup>

康威通向这条规则的路径经过了卡罗尔。《科学美国人》（*Scientific American*）的长期专栏作家马丁·加德纳（Martin Gardner）同时也是一位卡罗尔学者，他读到了卡罗尔的算法，并告诉了他的朋友康威，挑战他想出一个更简单的算法。康威于1973年提出了一个简单得多的算法，并将其命名为末日规则。<sup>[6](https://www.scientificamerican.com/article/calendar-algorithm/)</sup>康威计算某年末日的公式与卡罗尔的基本相同；他的创新在于那套每月锚定日期，从而免去了处理遥远的月日差值的需要。<sup>[7](https://link.springer.com/article/10.1007/s00283-022-10229-3)</sup>

## 改进与替代方案

后来的作者修改了年份偏移这一步。张伯伦·方（Chamberlain Fong）和迈克尔·K·沃尔特斯（Michael K. Walters）提出了“奇数+11”法，他们认为这比卡罗尔的方法更容易心算，因为需要的除法和记忆更少。方2010年的arXiv论文用一个基于数字的表达式取代了康威的\( \lfloor x/12 \rfloor + x \bmod 12 + \lfloor (x \bmod 12)/4 \rfloor \)项，认为对单个十进制数字进行操作使算法更容易心算。2022年《数学智能者》（*The Mathematical Intelligencer*）上的一篇短文给出了公式\( g(n) = 5(c_{2} + y_{2} - 1) + 10y \)，它只使用除法余数以及5和10的乘数，在十进制算术中很容易；参数\( k \)可以改变，以使用不同于康威末日的另一个锚定日。王祥生（Xiang-Sheng Wang）2014年的零日算法提供了另一套便于记忆的锚定日期列表，并有其自己的世纪和年份公式。<sup>[6](https://www.scientificamerican.com/article/calendar-algorithm/)</sup><sup> • </sup><sup>[10](https://arxiv.org/abs/1006.3913)</sup><sup> • </sup><sup>[7](https://link.springer.com/article/10.1007/s00283-022-10229-3)</sup><sup> • </sup><sup>[11](https://arxiv.org/abs/1404.2510)</sup>

对于编程而非心算，泽勒同余式通常是更方便的选择，因为它在一个公式中直接从月、日、年的数字计算出星期几。<sup>[5](https://www.nanamic.org.uk/app/download/32831492/BCME%2BFinal%2BReport.pdf)</sup>2026年的一篇arXiv论文用结构化查表——“灾难表”（Calamity Tables）——取代了年份偏移和月日算术，利用了格里高利历星期周期28年的周期性，并证明在锚定日期系统的七个等价类中，康威的日期为这种编码产生了最佳代码表。<sup>[12](https://arxiv.org/abs/2605.03329)</sup>

## 适用范围与实践

该规则适用于始于1582年的格里高利历。<sup>[13](https://doomsdaymethod.com/doomsday-algorithm/)</sup>对于英格兰在1752年9月之前使用的儒略历，年份\( C \cdot 100 \)的末日为\( 6C \)。<sup>[14](https://people.se.cmich.edu/graha1sw/pub/doomsday/doomsday.html)</sup>据说康威本人每天练习这些计算以保持速度，也有训练程序和应用程序用于同样的目的。<sup>[1](https://www.timeanddate.com/date/doomsday-rule.html)</sup><sup> • </sup><sup>[15](https://github.com/bradleypallen/doomsday)</sup>

## References

1. [The Doomsday Rule, timeanddate.com](https://www.timeanddate.com/date/doomsday-rule.html)
2. [John Horton Conway, "Tomorrow is the day after Doomsday," *Eureka* no. 36 (October 1973), reproduced by Simon Plantinga](https://simonplantinga.nl/posts/conway-doomsday/)
3. [Doomsday rule, NIST Dictionary of Algorithms and Data Structures](https://xlinux.nist.gov/dads/HTML/doomsday.html)
4. [The Doomsday rule, S. W. Graham, Central Michigan University](https://people.se.cmich.edu/graha1sw/pub/doomsday/doomsday.pdf)
5. [Informal Proceedings of the 9th British Congress of Mathematics Education (2018)](https://www.nanamic.org.uk/app/download/32831492/BCME%2BFinal%2BReport.pdf)
6. [What Day Is Doomsday? How to Mentally Calculate the Day of the Week for Any Date, Scientific American (2010)](https://www.scientificamerican.com/article/calendar-algorithm/)
7. [A Simple Formula for Doomsday, The Mathematical Intelligencer (2022)](https://link.springer.com/article/10.1007/s00283-022-10229-3)
8. [E. L. Cohen, "What day of the week is it?", CUBO, A Mathematical Journal, vol. 2 no. 1 (2000)](https://cubo.ufro.cl/index.php/cubo/article/view/1760)
9. [Lewis Carroll, "To Find the Day of the Week for Any Given Date," Nature, March 31, 1887](https://schnark.github.io/lewis-carroll/html/magazines/to-find-the-day-of-the-week.html)
10. [Chamberlain Fong, Methods for Accelerating Conway's Doomsday Algorithm (part 1), arXiv:1006.3913 (2010)](https://arxiv.org/abs/1006.3913)
11. [Xiang-Sheng Wang, Calculating the day of the week: null-days algorithm, arXiv:1404.2510 (2014)](https://arxiv.org/abs/1404.2510)
12. [Thomas Wollin, Table-Based Encodings for Conway's Doomsday Algorithm, arXiv:2605.03329 (2026)](https://arxiv.org/abs/2605.03329)
13. [Doomsday Algorithm: How the Doomsday Rule Works, doomsdaymethod.com](https://doomsdaymethod.com/doomsday-algorithm/)
14. [The Doomsday Rule, S. W. Graham, Central Michigan University (HTML)](https://people.se.cmich.edu/graha1sw/pub/doomsday/doomsday.html)
15. [bradleypallen/doomsday, a Doomsday rule trainer on GitHub](https://github.com/bradleypallen/doomsday)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 测量与时间 › 历法 › Calendar mechanics and reform › Calendrical calculation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/doomsday-rule

English original: https://www.edgepedia.org/doomsday-rule
