Excel 错误地认为 1900 年是闰年。
Excel incorrectly assumes that the year 1900 is a leap year

原始链接: https://learn.microsoft.com/en-us/troubleshoot/microsoft-365-apps/excel/wrongly-assumes-1900-is-leap-year

Microsoft Excel 将 1900 年错误地视为闰年,这是为了与 Lotus 1-2-3 保持历史兼容性。在 Excel 开发时,为了便于文件传输和用户体验,优先保持与 Lotus 的日期系统一致——该系统*错误地*将 1900 年包含为闰年。 虽然从技术上讲不准确,但纠正此行为会导致严重破坏。现有的 Excel 电子表格中的所有日期都会提前一天,需要大量的手动调整,并可能导致公式失效。与依赖当前系统的其他程序兼容性也会丧失。 保持此错误的唯一缺点是,对于 1900 年 3 月 1 日*之前*的日期,WEEKDAY 函数的结果不准确——这种情况大多数用户很少遇到。因此,微软选择保留 1900 年闰年的假设,以避免广泛的并发症。Excel 正确计算所有其他闰年。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Excel 错误地认为 1900 年是闰年 (learn.microsoft.com) 15 分,susam 28 分钟前 | 隐藏 | 过去 | 收藏 | 1 条评论 帮助 nippoo 7 分钟前 [–] 在其他“不正确的日历”错误中,有 Rockchip RK808 RTC,工程师认为 11 月有 31 天,至今仍需要 Linux 内核补丁来在格里高利历和 Rockchip 日历之间进行转换(它们会随着时间的推移逐渐发散)。 还有我最喜欢的内核补丁消息之一:https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin....回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Symptoms

Microsoft Excel incorrectly assumes that the year 1900 is a leap year. This article explains why the year 1900 is treated as a leap year, and outlines the behaviors that may occur if this specific issue is corrected.

More Information

When Lotus 1-2-3 was first released, the program assumed that the year 1900 was a leap year, even though it actually was not a leap year. This made it easier for the program to handle leap years and caused no harm to almost all date calculations in Lotus 1-2-3.

When Microsoft Multiplan and Microsoft Excel were released, they also assumed that 1900 was a leap year. This assumption allowed Microsoft Multiplan and Microsoft Excel to use the same serial date system used by Lotus 1-2-3 and provide greater compatibility with Lotus 1-2-3. Treating 1900 as a leap year also made it easier for users to move worksheets from one program to the other.

Although it is technically possible to correct this behavior so that current versions of Microsoft Excel do not assume that 1900 is a leap year, the disadvantages of doing so outweigh the advantages.

If this behavior were to be corrected, many problems would arise, including:

  • Almost all dates in current Microsoft Excel worksheets and other documents would be decreased by one day. Correcting this shift would take considerable time and effort, especially in formulas that use dates.
  • Some functions, such as the WEEKDAY function, would return different values; this might cause formulas in worksheets to work incorrectly.
  • Correcting this behavior would break serial date compatibility between Microsoft Excel and other programs that use dates.

If the behavior remains uncorrected, only one problem occurs:

  • The WEEKDAY function returns incorrect values for dates before March 1, 1900. Because most users do not use dates before March 1, 1900, this problem is rare.

NOTE: Microsoft Excel correctly handles all other leap years, including century years that are not leap years (for example, 2100). Only the year 1900 is incorrectly handled.

References

For more information about determining whether a given year is a leap year, see Method to Determine Whether a Year Is a Leap Year.

联系我们 contact @ memedata.com