为啥很多软件使用1904年1月1日作为起始时间

我发现就你一个提问过这个问题,自己也不懂,百度了一个分享下。1900年日期系统与 1904年日期系统1904 日期系统在 1904 年日期系统中,所支持的第一天是 1904 年 1 月 1。您输入了日期时, 该日期是转换为代表的 1904 年 1 月 1 之后的已用天数的序列数。示例如果输入 1998 年 7 月 5 则 Microsoft Excel 会将该日期转换为序列号 34519。默认状态下,Microsoft Excel 在 macintosh 使用 1904 年日期系统。 由于早期 Macintosh 计算机的设计,不支持 1904 年 1 月 1 之前的日期 ; 这种设计为了防止与 1900年不是闰年这一事实相关的问题。请注意是否切换 1900年日期系统中为 Macintosh 的 Microsoft Excel 不会支持日期尽早 1900 年 1 月 1。1904年圣路易斯世博会 计算机:灵魂从此生长不知道和这一个世博会有无关系,但是没讲……
■网友的回复
1900 日期系统 在 1900年日期系统中,所支持的第一天是 1900 年 1 月 1。您输入了日期时, 该日期是转换为类型的值,该值代表的自 1900 年 1 月 1 的已用天数的序列号。示例如果输入 1998 年 7 月 5 则 Microsoft Excel 会将该日期转换为序列号 35981。 默认状态下,windows 的 Microsoft Excel 和 Microsoft Excel 用于 Windows NT 使用 1900年日期系统中。1900 年日期系统允许更大的兼容性,Microsoft Excel 和其他电子表格程序之间,如 Lotus 1-2-3 中,在 MS-DOS 或 Microsoft Windows 下运行而设计的。
1904 日期系统 在 1904 年日期系统中,所支持的第一天是 1904 年 1 月 1。您输入了日期时, 该日期是转换为代表的 1904 年 1 月 1 之后的已用天数的序列数。示例如果输入 1998 年 7 月 5 则 Microsoft Excel 会将该日期转换为序列号 34519。 默认状态下,Microsoft Excel 在 macintosh 使用 1904 年日期系统。 由于早期 Macintosh 计算机的设计,不支持 1904 年 1 月 1 之前的日期 ; 这种设计为了防止与 1900年不是闰年这一事实相关的问题。请注意是否切换 1900年日期系统中为 Macintosh 的 Microsoft Excel 不会支持日期尽早 1900 年 1 月 1。
日期系统之间差异 因为两个日期系统使用不同的起始日期,每个日期系统中将由不同的序列号表示相同的日期。例如对于 1998 年 7 月 5 可以有两个不同的序列号。
日期系统之间差异 因为两个日期系统使用不同的起始日期,每个日期系统中将由不同的序列号表示相同的日期。例如对于 1998 年 7 月 5 可以有两个不同的序列号。
原因:
一般规定一个四位数的年份如果能被4整除,那么就是闰年。可是由于每四年一个闰年又太多了,与实际不符,所以规定十位和个位都是0的年份必须满足能被400整除,才是闰年。显然1900这个数字不能被400整除啊,所以它就不是闰年。
一个回归年不是365天,而是365天5小时48分46秒,多出的时间就会累积起来,新年就会后移,所以每隔四年就设一个闰年,这一年的二月改为29天.这样,闰年就有366天.但是,这样每一百年又差不多多了一天,所以又规定"百年"不设闰,即"百年24闰".但百年扣一天闰还是不刚好,于是又规定,公元年数为400倍数者设闰.如1988,2004能被4整除,为闰年,而1900,2100不设闰,2000能被400整除,设闰.
这是我在网上找到的,希望能帮到你。
■网友的回复
找到一篇英文的解释,因为数学上的便利
The resetting of the Mac\u0026#39;s system date to 1/1/1904 has beenexplained before, even on this site - see for example 1/1/2K Just Another Day for Macs, whichexplains that the number of bits in the original Mac dedicated tocounting dates limits the number of individual days that can be counted- and you have to start counting somewhere.
Also, the reason 1904 was selected is explained clearly in an article by GeoffDuncan.
Duncan writes, "And as for the year 2040 , there\u0026#39;s an interesting explanationbehind Apple\u0026#39;s odd expiration date. The original Mac development teamchose midnight, January 1, 1904, as the start of the Mac calendar - inpart because it\u0026#39;s mathematically convenient to have a calendarsystem start on a leap year , which 1900 was not.And since the calendar was built to cover approximately 136 years, yourMac OS won\u0026#39;t expire until the start of the year 2040."
Why is it "mathematically convenient"? I suspect it is because theformula used to convert the number of days since "time zero" in 1904does so by counting the number of leap years between the current dateand the "time zero" date. This is simply a matter of taking the numberof integer years divided by 4, unless you extend dates to before1900 - which would require an if-then branch to add a day back in onthat date since 1900 was not a leap year.
In the early days of computing (unlike today) every byte countedbecause of limited storage space. For the same reasons that ledMicrosoft and many others to use a two-digit year, prompting the wholeY2K issue, Macintosh programmers decided to start on a date thateliminated a tiny bit of code.
【为啥很多软件使用1904年1月1日作为起始时间】 Well, that explains everything except for one thing. Why wasn\u0026#39;t1900 a leap year? 2000 was a leap year, and if there\u0026#39;s a leap yearevery 4 years, shouldn\u0026#39;t 1900 have been a leap year.
Well, that\u0026#39;s a different story.
According to http://timeanddate.com,the leap year rules aren\u0026#39;t as simple as most people think. Because theearth\u0026#39;s year is not exactly 365.2500 days long, the old Julian calendarrule of "one leap day every four years" isn\u0026#39;t sufficient to keep theearth\u0026#39;s position in its orbit approximately constant for the same dateas the years go by. Without leap years, the calendar will graduallyshift until it\u0026#39;s snowing in July in Los Angeles.
An error like this actually prompted a shift of several days inmid-month both in 1582 and 1782. One day it was September 2, and thenext September 14. You can imagine the confusion that caused - muchgreater than a date reset on a Macintosh.
Anyway, next time you\u0026#39;re working on a dead Mac and someone asks "Why1904?" you can respond with a relatively simple answer: "Because therearen\u0026#39;t exactly 365 days in a year."
Join us on Facebook, follow us on Twitter or Google+, or subscribe to our RSS news feed
is a longtime Mac user. He was using digital sensors on Apple II computers in the 1980\u0026#39;s and has networked computers in his classroom since before the internet existed. In 2006 he was selected at the California Computer Using Educator\u0026#39;s teacher of the year. His students have used NASA space probes and regularly participate in piloting new materials for NASA. He is the author of two books and numerous articles and scientific papers. He currently teaches astronomy and physics in California, where he lives with his twin sons, Jony and Ben.\u0026lt; And there\u0026#39;s still a Mac G3 in his classroom which finds occasional use.


    推荐阅读