{"id":45942,"date":"2023-04-15T14:08:37","date_gmt":"2023-04-15T06:08:37","guid":{"rendered":"http:\/\/gulass.cn\/?p=45942"},"modified":"2023-04-15T14:08:37","modified_gmt":"2023-04-15T06:08:37","slug":"why-computer-time","status":"publish","type":"post","link":"https:\/\/gulass.cn\/why-computer-time.html","title":{"rendered":"\u4e3a\u4ec0\u4e48\u8ba1\u7b97\u673a\u65f6\u95f4\u8981\u4ece1970\u5e741\u67081\u65e5\u5f00\u59cb\u7b97\u8d77"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4eca\u5929\u6211\u4eec\u6765\u8ba8\u8bba\u4e00\u4e2a\u975e\u5e38\u6709\u610f\u601d\u7684\u4e8b\uff0c\u90a3\u5c31\u662f\u4f60\u77e5\u9053\u4e3a\u4ec0\u4e48\u8ba1\u7b97\u673a\u65f6\u95f4\u548c\u4f17\u591a\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u65f6\u95f4\u90fd\u8981\u4ece1970\u5e741\u67081\u65e5\u5f00\u59cb\u7b97\u8d77\u5462\uff0c\u65f6\u95f4\u8ba1\u65f6\u8d77\u70b9\u5230\u5e95\u4e3a\u4ec0\u4e48\u662f 1970\u5e741\u67081\u53f7\u5462\uff1f\u6211\u60f3\u5927\u5bb6\u5e94\u8be5\u90fd\u77e5\u9053\uff0c\u4f46\u662f\u6211\u4f30\u8ba1\u5927\u5bb6\u51e0\u4e4e\u5927\u90e8\u5206\u90fd\u6ca1\u6709\u60f3\u8fc7\u8fd9\u4e2a\u95ee\u9898\u3002\u6211\u4eec\u5c31\u4e00\u8d77\u6765\u804a\u804a\uff0c\u8fd9\u662f\u4e3a\u4ec0\u4e48\uff1f<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

1\u3001\u6700\u61d2\u7684\u89e3\u91ca<\/strong><\/div>\n

\u5f88\u591a\u7f16\u7a0b\u8bed\u8a00\u8d77\u6e90\u4e8eUNIX\u7cfb\u7edf\uff0c\u800cUNIX\u7cfb\u7edf\u8ba4\u4e3a1970\u5e741\u67081\u65e50\u70b9\u662f\u65f6\u95f4\u7eaa\u5143\uff0c\u6240\u4ee5\u6211\u4eec\u5e38\u8bf4\u7684UNIX\u65f6\u95f4\u6233\u662f\u4ee51970\u5e741\u67081\u65e50\u70b9\u4e3a\u8ba1\u65f6\u8d77\u70b9\u65f6\u95f4\u7684\u3002<\/p>\n

\u8bf4\u4e86\u8fd9\u4e2a\u61d2\u4eba\u7684\u89e3\u91ca\uff0c\u4f30\u8ba1\u5927\u5bb6\u8fd8\u6ca1\u6709\u61c2\u5f97\u771f\u6b63\u7684\u610f\u601d\u3002\u6240\u4ee5\u6211\u4eec\u63a5\u4e0b\u6765\u6df1\u5165\u7684\u4e86\u89e3\u4e00\u4e0b\u3002\n<\/p>\n

2\u3001\u6df1\u5165\u4e86\u89e3<\/strong><\/div>\n

\u6700\u521d\u8ba1\u7b97\u673a\u64cd\u4f5c\u7cfb\u7edf\u662f32\u4f4d\uff0c\u800c\u65f6\u95f4\u4e5f\u662f\u752832\u4f4d\u8868\u793a\u3002<\/p>\n

\r\n1.System.out.println(Integer.MAX_VALUE);\r\n2.2147483647\r\n<\/pre>\n

Integer \u5728JAVA\u5185\u752832\u4f4d\u8868\u793a\uff0c\u56e0\u6b6432\u4f4d\u80fd\u8868\u793a\u7684\u6700\u5927\u503c\u662f2147483647\u3002\u53e6\u59161\u5e74365\u5929\u7684\u603b\u79d2\u6570\u662f 31536000\uff0c2147483647\/31536000 = 68.1\uff0c\u4e5f\u5c31\u662f\u8bf432\u4f4d\u80fd\u8868\u793a\u7684\u6700\u957f\u65f6\u95f4\u662f68\u5e74\uff0c\u4ece1970\u5e74\u5f00\u59cb\u7684\u8bdd\uff0c\u52a0\u4e0a68.1\uff0c\u5b9e\u9645\u6700\u7ec8\u52302038\u5e7401\u670819\u65e503\u65f614\u520607\u79d2\uff0c\u4fbf\u4f1a\u5230\u8fbe\u6700\u5927\u65f6\u95f4\uff0c\u8fc7\u4e86\u8fd9\u4e2a\u65f6\u95f4\u70b9\uff0c\u6240\u670932\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u65f6\u95f4\u4fbf\u4f1a\u53d8\u4e3a 10000000 00000000 00000000 00000000\uff0c\u7b97\u4e0b\u6765\u4e5f\u5c31\u662f1901\u5e7412\u670813\u65e520\u65f645\u520652\u79d2\uff0c\u8fd9\u6837\u4fbf\u4f1a\u51fa\u73b0\u65f6\u95f4\u56de\u5f52\u7684\u73b0\u8c61\uff0c\u5f88\u591a\u8f6f\u4ef6\u4fbf\u4f1a\u8fd0\u884c\u5f02\u5e38\u4e86\u3002<\/p>\n

\u5230\u8fd9\u91cc\uff0c\u6211\u60f3\u95ee\u9898\u7684\u7b54\u6848\u5df2\u7ecf\u663e\u73b0\u51fa\u6765\u4e86\uff0c\u90a3\u5c31\u662f:\u56e0\u4e3a\u752832\u4f4d\u6765\u8868\u793a\u65f6\u95f4\u7684\u6700\u5927\u95f4\u9694\u662f68\u5e74\uff0c\u800c\u6700\u65e9\u51fa\u73b0\u7684UNIX\u64cd\u4f5c\u7cfb\u7edf\u8003\u8651\u5230\u8ba1\u7b97\u673a\u4ea7\u751f\u7684\u5e74\u4ee3\u548c\u5e94\u7528\u7684\u65f6\u9650\u7efc\u5408\u53d6\u4e861970\u5e741\u67081\u65e5\u4f5c\u4e3aUNIX TIME\u7684\u7eaa\u5143\u65f6\u95f4(\u5f00\u59cb\u65f6\u95f4)\uff0c\u81f3\u4e8e\u65f6\u95f4\u56de\u5f52\u7684\u73b0\u8c61\u76f8\u4fe1\u968f\u774064\u4e3a\u64cd\u4f5c\u7cfb\u7edf\u7684\u4ea7\u751f\u9010\u6e10\u5f97\u5230\u89e3\u51b3\uff0c\u56e0\u4e3a\u752864\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u8868\u793a\u5230 292,277,026,596\u5e7412\u67084\u65e515\u65f630\u520608\u79d2\uff0c\u76f8\u4fe1\u6211\u4eec\u7684N\u4ee3\u5b50\u5b59\uff0c\u54ea\u6015\u5730\u7403\u6bc1\u706d\u90a3\u5929\u90fd\u4e0d\u7528\u6101\u4e0d\u591f\u7528\u4e86\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u65f6\u95f4\u5df2\u7ecf\u662f\u5343\u4ebf\u5e74\u4ee5\u540e \u4e86\u3002\n<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/developer.51cto.com\/art\/201508\/488060.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/gulass.cn\/why-computer-time.html<\/a>\u7f16\u8f91\uff1a\u5f20\u632f\u5b87\uff0c\u5ba1\u6838\u5458\uff1a\u82cf\u897f\u4e91<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u4eca\u5929\u6211\u4eec\u6765\u8ba8\u8bba\u4e00\u4e2a\u975e\u5e38\u6709\u610f\u601d\u7684\u4e8b\uff0c\u90a3\u5c31\u662f\u4f60\u77e5\u9053\u4e3a\u4ec0\u4e48\u8ba1\u7b97\u673a\u65f6\u95f4\u548c\u4f17\u591a\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u65f6\u95f4\u90fd\u8981\u4ece1970\u5e741\u6708 […]<\/p>\n","protected":false},"author":310,"featured_media":45969,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-45942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/45942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=45942"}],"version-history":[{"count":11,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/45942\/revisions"}],"predecessor-version":[{"id":269440,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/45942\/revisions\/269440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/45969"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=45942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=45942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=45942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}