{"id":356,"date":"2014-11-09T22:58:23","date_gmt":"2014-11-09T14:58:23","guid":{"rendered":"http:\/\/www.ipcpu.com\/?p=356"},"modified":"2014-11-09T22:58:23","modified_gmt":"2014-11-09T14:58:23","slug":"time-and-more","status":"publish","type":"post","link":"https:\/\/c.ipcpu.com\/2014\/11\/time-and-more\/","title":{"rendered":"\u5173\u4e8e\u65f6\u95f4\u3001\u65f6\u533a\u3001\u7cfb\u7edf\u65f6\u95f4\u548c\u786c\u4ef6\u65f6\u95f4"},"content":{"rendered":"
\u5173\u4e8e\u65f6\u95f4\u3001\u65f6\u533a\u3001\u7cfb\u7edf\u65f6\u95f4\u548c\u786c\u4ef6\u65f6\u95f4
\u65f6\u533a\uff08Time Zone)\u662f\u5730\u7403\u4e0a\u7684\u533a\u57df\u4f7f\u7528\u540c\u4e00\u4e2a\u65f6\u95f4\u5b9a\u4e49\u3002
1884\u5e74\u5728\u534e\u76db\u987f\u53ec\u5f00\u56fd\u9645\u7ecf\u5ea6\u4f1a\u8bae\u65f6\uff0c\u4e3a\u4e86\u514b\u670d\u65f6\u95f4\u4e0a\u7684\u6df7\u4e71\uff0c\u89c4\u5b9a\u5c06\u5168\u7403\u5212\u5206\u4e3a24\u4e2a\u65f6\u533a\u3002<\/p>\n
\u683c\u6797\u5a01\u6cbb\u6807\u51c6\u65f6\u95f4 GMT<\/strong> \u4e16\u754c\u534f\u8c03\u65f6\u95f4 UTC<\/strong> \u590f\u65e5\u8282\u7ea6\u65f6\u95f4DST<\/strong> \u7cfb\u7edf\u65f6\u95f4<\/strong> \u786c\u4ef6\u65f6\u95f4<\/strong> \u4e16\u754c\u65f6\u95f4<\/strong> \u5730\u65b9\u65f6\u95f4<\/strong> CST\u662f\u4ec0\u4e48\u610f\u601d\uff1f \u56e0\u6b64\u67e5\u770blinux\u7cfb\u7edf\u65f6\u95f4\uff0c\u6211\u8fd8\u662f\u5efa\u8bae\u4f7f\u7528\u540e\u4e24\u79cd\u65b9\u5f0f\u3002<\/p>\n \u5982\u4f55\u53bb\u6389hwclock\u4e2d\u663e\u793a\u7684CST\uff1f \u4f7f\u7528\u547d\u4ee4\u53ef\u4ee5\u67e5\u770bBIOS\u786c\u4ef6\u65f6\u95f4\uff1a<\/p>\n \u4f46\u56e0\u4e3aBIOS\u91cc\u9762\u6ca1\u6709\u65f6\u533a\u7684\u8bbe\u7f6e\uff0c\u56e0\u6b64\u6709\u4e24\u79cd\u65f6\u95f4\u8bbe\u5b9a\u65b9\u6cd5\u3002<\/p>\n UTC=yes \u5b58\u50a8UTC\u65f6\u95f4 \u67e5\u770b\u7cfb\u7edf\u662f\u5426\u542f\u7528\u4e86UTC\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n \u82e5\u7cfb\u7edf\u542f\u7528\u4e86UTC\uff0c\u5219\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n
\u5341\u4e03\u4e16\u7eaa\uff0c\u683c\u6797\u5a01\u6cbb\u7687\u5bb6\u5929\u6587\u53f0\u4e3a\u4e86\u6d77\u4e0a\u9738\u6743\u7684\u6269\u5f20\u8ba1\u753b\u800c\u8fdb\u884c\u5929\u4f53\u89c2\u6d4b\u30021675\u5e74\u65e7\u7687\u5bb6\u89c2\u6d4b\u6240(Old Royal Observatory) \u6b63\u5f0f\u6210\u7acb\uff0c\u5230\u4e861884\u5e74\u51b3\u5b9a\u4ee5\u901a\u8fc7\u683c\u6797\u5a01\u6cbb\u7684\u5b50\u5348\u7ebf\u4f5c\u4e3a\u5212\u5206\u5730\u7403\u4e1c\u897f\u4e24\u534a\u7403\u7684\u7ecf\u5ea6\u96f6\u5ea6\u3002\u89c2\u6d4b\u6240\u95e8\u53e3\u5899\u4e0a\u6709\u4e00\u4e2a\u6807\u5fd724\u5c0f\u65f6\u7684\u65f6\u949f\uff0c\u663e\u793a\u5f53\u4e0b\u7684\u65f6\u95f4\uff0c\u5bf9\u5168 \u7403\u800c\u8a00\uff0c\u8fd9\u91cc\u6240\u8bbe\u5b9a\u7684\u65f6\u95f4\u662f\u4e16\u754c\u65f6\u95f4\u53c2\u8003\u70b9\uff0c\u5168\u7403\u90fd\u4ee5\u683c\u6797\u5a01\u6cbb\u7684\u65f6\u95f4\u4f5c\u4e3a\u6807\u51c6\u6765\u8bbe\u5b9a\u65f6\u95f4\uff0c\u8fd9\u5c31\u662f\u6211\u4eec\u8033\u719f\u80fd\u8be6\u7684\u300c\u683c\u6797\u5a01\u6cbb\u6807\u51c6\u65f6\u95f4\u300d(Greenwich Mean Time\uff0c\u7b80\u79f0G.M.T.)\u7684\u7531\u6765\uff0c\u6807\u793a\u5728\u624b\u8868\u4e0a\uff0c\u5219\u4ee3\u8868\u6b64\u8868\u5177\u6709\u4e24\u5730\u65f6\u95f4\u529f\u80fd\uff0c\u4e5f\u5c31\u662f\u540c\u65f6\u53ef\u4ee5\u663e\u793a\u539f\u5c45\u5730\u548c\u53e6\u4e00\u4e2a\u56fd\u5ea6\u7684\u65f6\u95f4\u3002<\/p>\n
\u591a\u6570\u7684\u4e24\u5730\u65f6\u95f4\u8868\u90fd\u4ee5GMT\u6765\u8868\u793a\uff0c\u4f46\u4e5f\u6709\u4e9b\u4e24\u5730\u65f6\u95f4\u8868\u4e0a\u770b\u4e0d\u5230GMT\u5b57\u6837\uff0c\u51fa\u73b0\u7684\u53cd\u800c\u662fUTC\u8fd93\u4e2a\u82f1\u6587\u5b57\u6bcd\uff0c\u7a76\u7adf\u4f55\u8c13UTC\uff1f\u4e8b\u5b9e\u4e0a\uff0cUTC\u6307\u7684\u662f Coordinated Universal Time\uff0d \u4e16\u754c\u534f\u8c03\u65f6\u95f4\uff08\u53c8\u79f0\u4e16\u754c\u6807\u51c6\u65f6\u95f4\u3001\u4e16\u754c\u7edf\u4e00\u65f6\u95f4\uff09\uff0c\u662f\u7ecf\u8fc7\u5e73\u5747\u592a\u9633\u65f6(\u4ee5\u683c\u6797\u5a01\u6cbb\u65f6\u95f4GMT\u4e3a\u51c6)\u3001\u5730\u8f74\u8fd0\u52a8\u4fee\u6b63\u540e\u7684\u65b0\u65f6\u6807\u4ee5\u53ca\u4ee5\u300c\u79d2\u300d\u4e3a\u5355\u4f4d\u7684\u56fd\u9645\u539f\u5b50 \u65f6\u6240\u7efc\u5408\u7cbe\u7b97\u800c\u6210\u7684\u65f6\u95f4\uff0c\u8ba1\u7b97\u8fc7\u7a0b\u76f8\u5f53\u4e25\u8c28\u7cbe\u5bc6\uff0c\u56e0\u6b64\u82e5\u4ee5\u300c\u4e16\u754c\u6807\u51c6\u65f6\u95f4\u300d\u7684\u89d2\u5ea6\u6765\u8bf4\uff0cUTC\u6bd4GMT\u6765\u5f97\u66f4\u52a0\u7cbe\u51c6\u3002\u5176\u8bef\u5dee\u503c\u5fc5\u987b\u4fdd\u6301\u57280.9\u79d2\u4ee5\u5185\uff0c\u82e5 \u5927\u4e8e0.9\u79d2\u5219\u7531\u4f4d\u4e8e\u5df4\u9ece\u7684\u56fd\u9645\u5730\u7403\u81ea\u8f6c\u4e8b\u52a1\u4e2d\u592e\u5c40\u53d1\u5e03\u95f0\u79d2\uff0c\u4f7fUTC\u4e0e\u5730\u7403\u81ea\u8f6c\u5468\u671f\u4e00\u81f4\u3002\u6240\u4ee5\u57fa\u672c\u4e0aUTC\u7684\u672c\u8d28\u5f3a\u8c03\u7684\u662f\u6bd4GMT\u66f4\u4e3a\u7cbe\u786e\u7684\u4e16\u754c\u65f6\u95f4\u6807 \u51c6\uff0c\u4e0d\u8fc7\u5bf9\u4e8e\u73b0\u884c\u8868\u6b3e\u6765\u8bf4\uff0cGMT\u4e0eUTC\u7684\u529f\u80fd\u4e0e\u7cbe\u786e\u5ea6\u662f\u6ca1\u6709\u5dee\u522b\u7684\u3002<\/p>\n
\u6240\u8c13\u300c\u590f\u65e5\u8282\u7ea6\u65f6\u95f4\u300dDaylight Saving Time\uff08\u7b80\u79f0D.S.T.\uff09\uff0c\u662f\u6307\u5728\u590f\u5929\u592a\u9633\u5347\u8d77\u7684\u6bd4\u8f83\u65e9\u65f6\uff0c\u5c06\u65f6\u949f\u62e8\u5feb\u4e00\u5c0f\u65f6\uff0c\u4ee5\u63d0\u65e9\u65e5\u5149\u7684\u4f7f\u7528\uff0c\u5728\u82f1\u56fd\u5219\u79f0\u4e3a\u590f\u4ee4\u65f6\u95f4(Summer Time)\u3002\u8fd9\u4e2a\u6784\u60f3\u4e8e1784\u5e74\u7531\u7f8e\u56fd\u73ed\u6770\u660e\u00b7\u5bcc\u5170\u514b\u6797\u63d0\u51fa\u6765\uff0c1915\u5e74\u5fb7\u56fd\u6210\u4e3a\u7b2c\u4e00\u4e2a\u6b63\u5f0f\u5b9e\u65bd\u590f\u4ee4\u65e5\u5149\u8282\u7ea6\u65f6\u95f4\u7684\u56fd\u5bb6\uff0c\u4ee5\u524a\u51cf\u706f\u5149\u7167\u660e\u548c\u8017\u7535\u5f00\u652f\u3002 \u81ea\u6b64\u4ee5\u540e\uff0c\u5168\u7403\u4ee5\u6b27\u6d32\u548c\u5317\u7f8e\u4e3a\u4e3b\u7684\u7ea670\u4e2a\u56fd\u5bb6\u90fd\u5f15\u7528\u8fd9\u4e2a\u505a\u6cd5\u3002<\/p>\n
\u4e00\u822c\u8bf4\u6765\u5c31\u662f\u6211\u4eec\u6267\u884c date \u547d\u4ee4\u770b\u5230\u7684\u65f6\u95f4\uff0clinux\u7cfb\u7edf\u4e0b\u6240\u6709\u7684\u65f6\u95f4\u8c03\u7528\uff08\u9664\u4e86\u76f4\u63a5\u8bbf\u95ee\u786c\u4ef6\u65f6\u95f4\u7684\u547d\u4ee4\uff09\u90fd\u662f\u4f7f\u7528\u7684\u8fd9\u4e2a\u65f6\u95f4\u3002<\/p>\n
\u4e3b\u677f\u4e0aBIOS\u4e2d\u7684\u65f6\u95f4\uff0c\u7531\u4e3b\u677f\u7535\u6c60\u4f9b\u7535\u6765\u7ef4\u6301\u8fd0\u884c\uff0c\u7cfb\u7edf\u5f00\u673a\u65f6\u8981\u8bfb\u53d6\u8fd9\u4e2a\u65f6\u95f4\uff0c\u5e76\u6839\u636e\u5b83\u6765\u8bbe\u5b9a\u7cfb\u7edf\u65f6\u95f4\uff08\u6ce8\u610f\uff1a\u7cfb\u7edf\u542f\u52a8\u65f6\u6839\u636e\u786c\u4ef6\u65f6\u95f4\u8bbe\u5b9a\u7cfb\u7edf\u65f6\u95f4\u7684\u8fc7\u7a0b\u53ef\u80fd\u5b58\u5728\u65f6\u533a\u6362\u7b97\uff0c\u8fd9\u8981\u89c6\u5177\u4f53\u7684\u7cfb\u7edf\u53ca\u76f8\u5173\u8bbe\u7f6e\u800c\u5b9a\uff09\u3002<\/p>\n
\uff08Universal Time\uff09\u4e16\u754c\u6807\u51c6\u65f6\u95f4\u5373UTC\u3002<\/p>\n
\uff08\u672c\u5730\u65f6\u95f4\uff0cLocal Time\uff09\u7531\u4e8e\u5904\u5728\u4e0d\u540c\u7684\u65f6\u533a\uff0c\u672c\u5730\u65f6\u95f4\u4e00\u822c\u4e0eUTC\u662f\u4e0d\u540c\u7684\uff0c\u6362\u7b97\u65b9\u6cd5\u5c31\u662f\uff1a
\u672c\u5730\u65f6\u95f4 = UTC + \u65f6\u533a \u6216 UTC = \u672c\u5730\u65f6\u95f4 - \u65f6\u533a<\/p>\n\u4e8c. \u5728Linux\u4e2d\u67e5\u770b\u7cfb\u7edf\u65f6\u95f4<\/h3>\n
#date <\/span><\/code><\/li>
Fri<\/span> <\/span>Nov<\/span> <\/span>7<\/span> <\/span>23<\/span>:<\/span>21<\/span>:<\/span>34<\/span> CST <\/span>2014<\/span> <\/span>\/\/\u672c\u5730\u65f6\u95f4<\/span><\/code><\/li>
#date -R<\/span><\/code><\/li>
Fri<\/span>,<\/span> <\/span>07<\/span> <\/span>Nov<\/span> <\/span>2014<\/span> <\/span>23<\/span>:<\/span>21<\/span>:<\/span>35<\/span> <\/span>+<\/span>0800<\/span> <\/span>\/\/\u672c\u5730\u65f6\u95f4\uff0cRFC2822\u683c\u5f0f<\/span><\/code><\/li>
#date -u<\/span><\/code><\/li>
Fri<\/span> <\/span>Nov<\/span> <\/span>7<\/span> <\/span>15<\/span>:<\/span>21<\/span>:<\/span>37<\/span> UTC <\/span>2014<\/span> <\/span>\/\/UTC\u65f6\u95f4<\/span><\/code><\/li><\/ol><\/pre>\n
\u5176\u5b9eCST\u67094\u4e2d\u610f\u601d\uff0c\u6240\u4ee5\u8fd9\u91cc\u663e\u793aCST\u662f\u5f88\u5bb9\u6613\u88ab\u8bef\u89e3\u3002
Central Standard Time (USA) UT-6:00
Central Standard Time (Australia) UT+9:30
China Standard Time UT+8:00
Cuba Standard Time UT-4:00 <\/p>\n
\u6267\u884chwclock\u547d\u4ee4\u4e4b\u524d\uff0c\u6dfb\u52a0\u73af\u5883\u53d8\u91cf\"export LANG=C\"<\/p>\n#hwclock <\/span><\/code><\/li>
Sun<\/span> <\/span>09<\/span> <\/span>Nov<\/span> <\/span>2014<\/span> <\/span>07<\/span>:<\/span>38<\/span>:<\/span>25<\/span> PM CST <\/span>-<\/span>0.161066<\/span> seconds<\/span><\/code><\/li>
#export LANG=C<\/span><\/code><\/li>
#hwclock <\/span><\/code><\/li>
Sun<\/span> <\/span>Nov<\/span> <\/span>9<\/span> <\/span>19<\/span>:<\/span>38<\/span>:<\/span>35<\/span> <\/span>2014<\/span> <\/span>-<\/span>0.813925<\/span> seconds<\/span><\/code><\/li><\/ol><\/pre>\n
\u4e09. \u5728Linux\u4e2d\u67e5\u770b\u786c\u4ef6\u65f6\u95f4\uff08BIOS\u65f6\u95f4\uff09<\/h3>\n
hwclock <\/span>--<\/span>localtime<\/span><\/code><\/li><\/ol><\/pre>\n
UTC=no \u5b58\u50a8\u672c\u5730LOCAL\u65f6\u95f4<\/p>\nUTC<\/span>=<\/span>false<\/span> <\/span>or<\/span> UTC<\/span>=<\/span>true<\/span> <\/span>in<\/span> file <\/span>\/<\/span>etc<\/span>\/<\/span>sysconfig<\/span>\/<\/span>clock<\/span>,<\/span>RHEL5<\/span><\/code><\/li>
LOCAL <\/span>or<\/span> UTC <\/span>in<\/span> file<\/span>\/<\/span>etc<\/span>\/<\/span>adjtime<\/span>,<\/span>last<\/span> line<\/span>,<\/span>RHEL6 <\/span><\/code><\/li>
UTC<\/span>=<\/span>no<\/span> <\/span>or<\/span> UTC<\/span>=<\/span>yes <\/span>in<\/span> file <\/span>\/<\/span>etc<\/span>\/<\/span>default<\/span>\/<\/span>rcS<\/span>,<\/span>Debian6<\/span>,<\/span>Squeeze<\/span>.<\/span><\/code><\/li>
LOCAL <\/span>or<\/span> UTC <\/span>in<\/span> file<\/span>\/<\/span>etc<\/span>\/<\/span>adjtime<\/span>,<\/span>last<\/span> line<\/span>,<\/span>Debian7<\/span>,<\/span>Wheezy<\/span>.(<\/span>if<\/span> <\/span>not<\/span> exist<\/span>,<\/span>excute hwclock <\/span>--<\/span>adjust<\/span>)<\/span><\/code><\/li><\/ol><\/pre>\n
# export LANG=C<\/span><\/code><\/li>
# tail -1 \/etc\/adjtime <\/span><\/code><\/li>
UTC<\/span><\/code><\/li>
date <\/span>-<\/span>R<\/span><\/code><\/li>
# date -R<\/span><\/code><\/li>
Sun<\/span>,<\/span> <\/span>09<\/span> <\/span>Nov<\/span> <\/span>