为什么编程语言以及数据库要从1970年1月1日开始计算时

今天一时兴起想起了在SQL Server中使用DateTime.MinValue插入时间时报错的问题,原因就在于数据库的最小时间和.Net里的最小时间不一致导致的,网上查阅了些资料,找到如下结果
Net Framewrok 中,
DateTime.MinValue => 0001/01/01 00:00:00
SqlDateTime.MinValue.Value => 1753/01/01 00:00:00
SQL Server 2005 中,
DateTime 最小值 => 1753/01/01 00:00:00
SmallDateTime 最小值 => 1900/01/01 00:00:00
Net Framewrok 中,
DateTime.MaxValue => 9999/12/31 23:59:59.999
SqlDateTime.MaxValue.Value => 9999/12/31 23:59:59.997
SQL Server 2005 中,
DateTime 最大值 => 9999/12/31 23:59:59.997
SmallDateTime 最大值 =>2079.6.6

所以需要在数据库插入最小时间时不能使用DateTime.MinValue,需要使用

SqlDateTime.MinValue.Value。

好了到现在SQL Server数据库时间问题解决了,突然又想起了系统中有个啥1970年1月1日的时间。那这个时间又是啥来来历呢,怀着好奇宝宝的心理我有在网上查阅了一番得到如下解释:

1.可以简单的这样认为:UNIX系统认为1970年1月1日0点是时间纪元,所以我们常说的UNIX时间戳是以1970年1月1日0点为计时起点时间的。这个解释是懒人最爱^_^

2.这个比较科学
最初计算机操作系统是32位,而时间也是用32位表示。32位能表示的最大值是2147483647。另外1年365天的总秒数是31536000,2147483647/31536000 = 68.1,也就是说32位能表示的最长时间是68年,而实际上到2038年01月19日03时14分07秒,便会到达最大时间,过了这个时间点,所有32位操作系统时间便会变为10000000 00000000 00000000 00000000,也就是1901年12月13日20时45分52秒,这样便会出现时间回归的现象,很多软件便会运行异常了。

到这里,我想问题的答案已经出来了:因为用32位来表示时间的最大间隔是68年,而最早出现的UNIX操作系统考虑到计算机产生的年代和应用的时限综合取了1970年1月1日作为UNIX TIME的纪元时间(开始时间),至于时间回归的现象相信随着64为操作系统的产生逐渐得到解决,因为用64位操作系统可以表示到292,277,026,596年12月4日15时30分08秒,相信我们的N代子孙,哪怕地球毁灭那天都不用愁不够用了,因为这个时间已经是千亿年以后了。




附:另外文章

为什么这个时间会定义在197011日这个时候呢?

于是开始了Google,中文网页根本找不到答案。于是试着搜索英文关键字,Sun<wbr>java</wbr>论坛总算找到准确的帖子:

http://forums.sun.com/thread.jspa?threadID=595140&start=15

其中有一个回复:


I<wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">suspect</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">that</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">Java</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">was</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">born</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">and</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">raised</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">on</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">a</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">UNIX</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">system.</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">UNIX</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">considers</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">the</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">epoch</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">(when</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">did</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">time</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">begin)</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">to</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">be</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">midnight,</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">January</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">1,</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">1970.</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"></span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">是说</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">java</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">起源于</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">UNIX</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">系统,而</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">UNIX</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">认为</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1970</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">月</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">日</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">0</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">点是时间纪元</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">.</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">但这依然没很好的解释</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">"</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">为什么</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">",</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">出于好奇,继续</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">Google</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">,总算找到了答案</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">:</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">http://en.wikipedia.org/wiki/Unix_time</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">这里的解释是</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">:</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">最初计算机操作系统是</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位,而时间也是用</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位表示。</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">System.out.println(Integer.MAX_VALUE);</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">2147483647</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">Integer</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">在</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">JAVA</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">内用</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位表示,因此</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位能表示的最大值是</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">2147483647。另外</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">365</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">天的总秒数是</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">31536000,</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">2147483647/31536000</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">=</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">68.1</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">也就是说</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位能表示的最长时间是</span><span style="font-family:Courier New; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">68</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年,而实际上到</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">2038</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">01</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">月</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">19</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">日</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">03</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">时</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">14</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">分</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">07<br></span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">秒,便会到达最大时间,过了这个时间点,所有</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位操作系统时间便会变为</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">10000000</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">00000000</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">00000000</span><wbr style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">00000000</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"></span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">也就是1901</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">12</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">月</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">13</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">日</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">20</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">时</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">45</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">分</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">52</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">秒,这样便会出现时间回归的现象,很多软件便会运行异常了。</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">到这里,我想问题的答案已经出来了</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">:</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">因为用</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">32</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位来表示时间的最大间隔是</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">68</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年,而最早出现的</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">UNIX</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">操作系统考虑到计算<br> 机产生的年代和应用的时限综合取了</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1970</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">月</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">1</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">日作为</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">UNIX<wbr>TIME</wbr></span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">的纪元时间</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">(</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">开始<br> 时间</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">)</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">,而</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">java</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">自然也遵循了这一约束。</span><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><br style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)"><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">至于时间回归的现象相信随着</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">64</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">为操作系统的产生逐渐得到解决,因为用</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">64</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">位操作<br> 系统可以表示到</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">292,277,026,596</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">年</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">12</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">月</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">4</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">日</span><span style="color:rgb(73,73,73); font-family:simsun; font-size:14px; line-height:21px; background-color:rgb(254,254,254)">15</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">时</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">30</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">分</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">08</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">秒,相信我们的</span><span style="font-family:Times New Roman; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">N</span><span style="font-family:宋体; word-wrap:normal; word-break:normal; line-height:21px; color:rgb(73,73,73); font-size:14px; background-color:rgb(254,254,254)">代子孙,哪<br> 怕地球毁灭那天都不用愁不够用了,因为这个时间已经是千亿年以后了。<br><br> 最后一个问题:上面System.out.println(new Date(0)),打印出来的时间是8点而非0点,<br> 原因是存在系统时间和本地时间的问题,其实系统时间依然是0点,只不过我的电脑时区<br> 设置为东8区,故打印的结果是8点。<br><br> 我想以上问题如果作为面试题,也能难倒一批人了.</span><br></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

你可能感兴趣的:(编程语言)