{"id":697,"date":"2010-03-21T01:15:51","date_gmt":"2010-03-20T17:15:51","guid":{"rendered":"http:\/\/pony.xin\/?p=697"},"modified":"2021-03-12T20:58:37","modified_gmt":"2021-03-12T12:58:37","slug":"linux%e6%97%b6%e9%97%b4%e6%97%b6%e5%8c%ba%e7%9a%84%e4%bf%ae%e6%94%b9-%ef%bc%88fedora-11%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lnmp.ivan.xin\/?p=697","title":{"rendered":"linux\u65f6\u95f4\u65f6\u533a\u7684\u4fee\u6539 \uff08fedora 11\uff09"},"content":{"rendered":"<div>\n<div>\u5982\u679c\u4f60\u6709\u56fe\u5f62\u754c\u9762\uff0c\u76f4\u63a5\u70b9\u5f00\u754c\u9762\u4fee\u6539\u3002<br \/>\u5982\u679c\u4f60\u53ef\u4ee5\u8fd0\u884csystem-config-date\uff0c\u5c31\u8fd0\u884c\u8fd9\u4e2a\u547d\u4ee4\uff0c\u9009\u62e9\u4f60\u9700\u8981\u7684\u65f6\u533a\u5c31\u53ef\u4ee5\u4e86\u3002<br \/>\u4ee5\u4e0a\u4e24\u79cd\u65b9\u6cd5\u4e0d\u884c\u7684\u8bdd\u5c31\u91c7\u7528\u8fd9\u6837\u7684\u505a\u6cd5\uff1a<br \/># cp \/etc\/localtime \/etc\/localtime.bak<br \/># cp \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<br \/># vi \/etc\/sysconfig\/clock\u7684\u5185\u5bb9\u4e3a\uff1a<br \/>ZONE=\"Asia\/Shanghai\"<br \/>UTC=false<br \/>\u7136\u540e\u53ef\u4ee5\u91cd\u542f\u4e00\u4e0b\u6d4b\u8bd5<\/p>\n<p>\u4e0b\u8fb9\u8fd9\u4e9b\u5185\u5bb9\u662f\u4ece\u7f51\u4e0a\u627e\u7684\uff0c\u53ef\u4ee5\u53c2\u8003<\/p>\n<p>&nbsp;&nbsp;&nbsp; \u9488\u5bf9\u4e2d\u56fd\u65f6\u533a\uff0c\u4fee\u6539\u64cd\u4f5c\u5982\u4e0b<br \/>1.&nbsp;&nbsp; \u4fee\u6539\u6587\u4ef6 \/etc\/sysconfig\/clock\u5185\u5bb9\uff1a<br \/>ZONE=Asia\/Shanghai<br \/>UTC=false<br \/>ARC=false<br \/>2.&nbsp;&nbsp;&nbsp;&nbsp;<br \/>\n rm \/etc\/localtime<br \/>ln -sf \/usr\/share\/zoneinfo\/Asia\/Shanghai<br \/>\n\/etc\/localtime<\/div>\n<div>&nbsp;<\/div>\n<div>\u3000Linux\u65f6\u949f\u5206\u4e3a\u7cfb\u7edf\u65f6\u949f(System Clock)\u548c\u786c\u4ef6(Real Time<br \/>\nClock\uff0c\u7b80\u79f0RTC)\u65f6\u949f\u3002\u7cfb\u7edf\u65f6\u949f\u662f\u6307\u5f53\u524dLinux<br \/>\nKernel\u4e2d\u7684\u65f6\u949f\uff0c\u800c\u786c\u4ef6\u65f6\u949f\u5219\u662f\u4e3b\u677f\u4e0a\u7531\u7535\u6c60\u4f9b\u7535\u7684\u65f6\u949f\uff0c\u8fd9\u4e2a\u786c\u4ef6\u65f6\u949f\u53ef\u4ee5\u5728BIOS\u4e2d\u8fdb\u884c\u8bbe\u7f6e\u3002\u5f53Linux\u542f\u52a8\u65f6\uff0c\u786c\u4ef6\u65f6\u949f\u4f1a\u53bb\u8bfb\u53d6\u7cfb\u7edf\u65f6\u949f\u7684<br \/>\n \u8bbe\u7f6e\uff0c\u7136\u540e\u7cfb\u7edf\u65f6\u949f\u5c31\u4f1a\u72ec\u7acb\u4e8e\u786c\u4ef6\u8fd0\u4f5c\u3002<\/p>\n<p>\u3000\u3000Linux\u4e2d\u7684\u6240\u6709\u547d\u4ee4<br \/>\n(\u5305\u62ec\u51fd\u6570)\u90fd\u662f\u91c7\u7528\u7684\u7cfb\u7edf\u65f6\u949f\u8bbe\u7f6e\u3002\u5728Linux\u4e2d\uff0c\u7528\u4e8e\u65f6\u949f\u67e5\u770b\u548c\u8bbe\u7f6e\u7684\u547d\u4ee4\u4e3b\u8981\u6709date\u3001hwclock\u548cclock\u3002\u5176\u4e2d\uff0cclock\u548c<br \/>\nhwclock\u7528\u6cd5\u76f8\u8fd1\uff0c\u53ea\u4e0d\u8fc7clock\u547d\u4ee4\u9664\u4e86\u652f\u6301x86\u786c\u4ef6\u4f53\u7cfb\u5916\uff0c\u8fd8\u652f\u6301Alpha\u786c\u4ef6\u4f53\u7cfb\u3002<\/p>\n<p>\u3000\u30001\u3001date<\/p>\n<p>\u3000\u3000\u67e5\u770b\u7cfb\u7edf\u65f6\u95f4<\/p>\n<p>\u3000\u3000# date<\/p>\n<p>\u3000\u3000\u8bbe\u7f6e\u7cfb\u7edf\u65f6\u95f4<\/p>\n<p>\u3000\u3000# date --set=\u201c07\/07\/06 10:19\" \uff08\u6708\/\u65e5\/\u5e74 \u65f6:\u5206:\u79d2\uff09<\/p>\n<p>\u3000\u30002\u3001hwclock\/clock<\/p>\n<p>\u3000\u3000\u67e5\u770b\u786c\u4ef6\u65f6\u95f4<\/p>\n<p>\u3000\u3000# hwclock --show<\/p>\n<p>\u3000\u3000# clock --show<\/p>\n<p>\u3000\u3000\u8bbe\u7f6e\u786c\u4ef6\u65f6\u95f4<\/p>\n<p>\u3000\u3000# hwclock --set --date=\"07\/07\/06 10:19\" \uff08\u6708\/\u65e5\/\u5e74 \u65f6:\u5206:\u79d2\uff09<\/p>\n<p>\u3000\u3000# clock --set --date=\"07\/07\/06 10:19\" \uff08\u6708\/\u65e5\/\u5e74 \u65f6:\u5206:\u79d2\uff09<\/p>\n<p>\u3000\u30003\u3001\u786c\u4ef6\u65f6\u95f4\u548c\u7cfb\u7edf\u65f6\u95f4\u7684\u540c\u6b65<\/p>\n<p>\u3000\u3000\u6309\u7167\u524d\u9762\u7684\u8bf4\u6cd5\uff0c\u91cd\u65b0\u542f\u52a8\u7cfb\u7edf\uff0c\u786c\u4ef6\u65f6\u95f4\u4f1a\u8bfb\u53d6\u7cfb\u7edf\u65f6\u95f4\uff0c\u5b9e\u73b0\u540c\u6b65\uff0c\u4f46\u662f\u5728\u4e0d\u91cd\u65b0\u542f\u52a8\u7684\u65f6\u5019\uff0c\u9700\u8981\u7528hwclock\u6216clock\u547d\u4ee4\u5b9e\u73b0\u540c\u6b65\u3002<\/p>\n<p>\u3000\u3000\u786c\u4ef6\u65f6\u949f\u4e0e\u7cfb\u7edf\u65f6\u949f\u540c\u6b65\uff1a<\/p>\n<p>\u3000\u3000# hwclock --hctosys\uff08hc\u4ee3\u8868\u786c\u4ef6\u65f6\u95f4\uff0csys\u4ee3\u8868\u7cfb\u7edf\u65f6\u95f4\uff09<\/p>\n<p>\u3000\u3000\u6216\u8005<\/p>\n<p>\u3000\u3000# clock --hctosys<\/p>\n<p>\u3000\u3000\u7cfb\u7edf\u65f6\u949f\u548c\u786c\u4ef6\u65f6\u949f\u540c\u6b65\uff1a<\/p>\n<p>\u3000\u3000# hwclock --systohc<\/p>\n<p>\u3000\u3000\u6216\u8005<\/p>\n<p>\u3000\u3000# clock --systohc<\/p>\n<p>\u3000\u30004\u3001\u65f6\u533a\u7684\u8bbe\u7f6e<\/p>\n<p>\u3000\u3000# tzselect<\/p>\n<p>\u3000\u3000Please identify a location so that time zone rules can be set<br \/>\ncorrectly.<\/p>\n<p>\u3000\u3000Please select a continent or ocean.<\/p>\n<p>\u3000\u30001) Africa<\/p>\n<p>\u3000\u30002) Americas<\/p>\n<p>\u3000\u30003) Antarctica<\/p>\n<p>\u3000\u30004) Arctic Ocean<\/p>\n<p>\u3000\u30005) Asia<\/p>\n<p>\u3000\u30006) Atlantic Ocean<\/p>\n<p>\u3000\u30007) Australia<\/p>\n<p>\u3000\u30008) Europe<\/p>\n<p>\u3000\u30009) Indian Ocean<\/p>\n<p>\u3000\u300010) Pacific Ocean<\/p>\n<p>\u3000\u300011) none - I want to specify the time zone using the Posix TZ<br \/>\nformat.<\/p>\n<p>\u3000\u3000#? \u8f93\u51655\uff0c\u4e9a\u6d32<\/p>\n<p>&nbsp;<\/p>\n<p>Please select a country.<br \/>1) Afghanistan 18) Israel 35) Palestine<br \/>2)<br \/>\n Armenia 19) Japan 36) Philippines<br \/>3) Azerbaijan 20) Jordan 37) Qatar<br \/>4)<br \/>\n Bahrain 21) Kazakhstan 38) Russia<br \/>5) Bangladesh 22) Korea (North)<br \/>\n39) Saudi Arabia<br \/>6) Bhutan 23) Korea (South) 40) Singapore<br \/>7)<br \/>\nBrunei 24) Kuwait 41) Sri Lanka<br \/>8) Cambodia 25) Kyrgyzstan 42) Syria<br \/>9)<br \/>\n China 26) Laos 43) Taiwan<br \/>10) Cyprus 27) Lebanon 44) Tajikistan<br \/>11)<br \/>\n East Timor 28) Macau 45) Thailand<br \/>12) Georgia 29) Malaysia 46)<br \/>\nTurkmenistan<br \/>13) Hong Kong 30) Mongolia 47) United Arab Emirates<br \/>14)<br \/>\n India 31) Myanmar (Burma) 48) Uzbekistan<br \/>15) Indonesia 32) Nepal 49)<br \/>\n Vietnam<br \/>16) Iran 33) Oman 50) Yemen<br \/>17) Iraq 34) Pakistan<br \/>#?<br \/>\n\u8f93\u51659\uff0c<span>\u4e2d\u56fd<\/span><\/p>\n<p>Please<br \/>\n select one of the following time zone regions.<br \/>1) east China -<br \/>\nBeijing, Guangdong, Shanghai, etc.<br \/>2) Heilongjiang<br \/>3) central<br \/>\nChina - Gansu, Guizhou, Sichuan, Yunnan, etc.<br \/>4) Tibet &amp; most of<br \/>\nXinjiang Uyghur<br \/>5) southwest Xinjiang Uyghur<br \/>#? \u8f93\u51651\uff0c<span>\u5317\u4eac<\/span>\u65f6<br \/>\n\u95f4<\/p>\n<p>The following information has been given:<\/p>\n<p>China<br \/>east<br \/>\nChina - Beijing, Guangdong, Shanghai, etc.<\/p>\n<p>Therefore<br \/>\nTZ='Asia\/Shanghai' will be used.<br \/>Local time is now: Fri Jul 7<br \/>\n10:32:18 CST 2006.<br \/>Universal Time is now: Fri Jul 7 02:32:18 UTC<br \/>\n2006.<br \/>Is the above information OK?<br \/>1) Yes<br \/>2) No<br \/>#? \u8f93\u51651\uff0c\u786e\u8ba4<\/p>\n<p>\u5982<br \/>\n\u679c\u4e0d\u7528tzselect\u547d\u4ee4\uff0c\u53ef\u4ee5\u4fee\u6539<span>\u6587\u4ef6<\/span>\u53d8<br \/>\n\u66f4\u65f6\u533a\u3002<\/p>\n<p># vi \/etc\/sysconfig\/clock <br \/>ZONE=Asia\/Shanghai\uff08\u67e5\/usr\/share<br \/>\n\/zoneinfo\u4e0b\u9762\u7684\u6587\u4ef6\uff09 <br \/>UTC=false <br \/>ARC=false<\/p>\n<p># rm \/etc\/localtime<\/p>\n<p>#<br \/>\n ln -sf \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/p>\n<p>\u91cd\u65b0\u542f\u52a8\u5373\u53ef\u3002<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4f60\u6709\u56fe\u5f62\u754c\u9762\uff0c\u76f4\u63a5\u70b9\u5f00\u754c\u9762\u4fee\u6539\u3002\u5982\u679c\u4f60\u53ef\u4ee5\u8fd0\u884csystem-config-date\uff0c\u5c31\u8fd0\u884c\u8fd9\u4e2a\u547d\u4ee4\uff0c\u9009\u62e9\u4f60...<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-697","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=697"}],"version-history":[{"count":1,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/697\/revisions"}],"predecessor-version":[{"id":698,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=\/wp\/v2\/posts\/697\/revisions\/698"}],"wp:attachment":[{"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lnmp.ivan.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}