{"id":1067,"date":"2019-04-25T12:16:14","date_gmt":"2019-04-25T04:16:14","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1067"},"modified":"2019-04-28T12:23:08","modified_gmt":"2019-04-28T04:23:08","slug":"hwclock","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/hwclock","title":{"rendered":"hwclock\u547d\u4ee4 – \u7cfb\u7edf\u8bbe\u7f6e"},"content":{"rendered":"\n

hwclock\u547d\u4ee4\u662f\u4e00\u4e2a\u786c\u4ef6\u65f6\u949f\u8bbf\u95ee\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u663e\u793a\u5f53\u524d\u65f6\u95f4\u3001\u8bbe\u7f6e\u786c\u4ef6\u65f6\u949f\u7684\u65f6\u95f4\u548c\u8bbe\u7f6e\u786c\u4ef6\u65f6\u949f\u4e3a\u7cfb\u7edf\u65f6\u95f4\uff0c\u4e5f\u53ef\u8bbe\u7f6e\u7cfb\u7edf\u65f6\u95f4\u4e3a\u786c\u4ef6\u65f6\u949f\u7684\u65f6\u95f4\u3002<\/p>\n\n\n\n

\u5728Linux\u4e2d\u6709\u786c\u4ef6\u65f6\u949f\u4e0e\u7cfb\u7edf\u65f6\u949f\u7b49\u4e24\u79cd\u65f6\u949f\u3002\u786c\u4ef6\u65f6\u949f\u662f\u6307\u4e3b\u673a\u677f\u4e0a\u7684\u65f6\u949f\u8bbe\u5907\uff0c\u4e5f\u5c31\u662f\u901a\u5e38\u53ef\u5728BIOS\u753b\u9762\u8bbe\u5b9a\u7684\u65f6\u949f\u3002\u7cfb\u7edf\u65f6\u949f\u5219\u662f\u6307kernel\u4e2d\u7684\u65f6\u949f\u3002\u5f53Linux\u542f\u52a8\u65f6\uff0c\u7cfb\u7edf\u65f6\u949f\u4f1a\u53bb\u8bfb\u53d6\u786c\u4ef6\u65f6\u949f\u7684\u8bbe\u5b9a\uff0c\u4e4b\u540e\u7cfb\u7edf\u65f6\u949f\u5373\u72ec\u7acb\u8fd0\u4f5c\u3002\u6240\u6709Linux\u76f8\u5173\u6307\u4ee4\u4e0e\u51fd\u6570\u90fd\u662f\u8bfb\u53d6\u7cfb\u7edf\u65f6\u949f\u7684\u8bbe\u5b9a\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>hwclock [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
--debug  <\/td>\u663e\u793ahwclock\u6267\u884c\u65f6\u8be6\u7ec6\u7684\u4fe1\u606f\u3002 <\/td><\/tr>
--directisa <\/td>hwclock\u9884\u8bbe\u4ece\/dev\/rtc\u8bbe\u5907\u6765\u5b58\u53d6\u786c\u4ef6\u65f6\u949f\u3002\u82e5\u65e0\u6cd5\u5b58\u53d6\u65f6\uff0c\u53ef\u7528\u6b64\u53c2\u6570\u76f4\u63a5\u4ee5I\/O\u6307\u4ee4\u6765\u5b58\u53d6\u786c\u4ef6\u65f6\u949f\u3002 <\/td><\/tr>
--hctosys  <\/td>\u5c06\u7cfb\u7edf\u65f6\u949f\u8c03\u6574\u4e3a\u4e0e\u76ee\u524d\u7684\u786c\u4ef6\u65f6\u949f\u4e00\u81f4\u3002 <\/td><\/tr>
--set --date=<\u65e5\u671f\u4e0e\u65f6\u95f4>  <\/td>\u8bbe\u5b9a\u786c\u4ef6\u65f6\u949f\u3002 <\/td><\/tr>
--show <\/td>\u663e\u793a\u786c\u4ef6\u65f6\u949f\u7684\u65f6\u95f4\u4e0e\u65e5\u671f\u3002 <\/td><\/tr>
--systohc <\/td>\u5c06\u786c\u4ef6\u65f6\u949f\u8c03\u6574\u4e3a\u4e0e\u76ee\u524d\u7684\u7cfb\u7edf\u65f6\u949f\u4e00\u81f4\u3002 <\/td><\/tr>
--test  <\/td>\u4ec5\u6d4b\u8bd5\u7a0b\u5e8f\uff0c\u800c\u4e0d\u4f1a\u5b9e\u9645\u66f4\u6539\u786c\u4ef6\u65f6\u949f\u3002 <\/td><\/tr>
--utc <\/td>\u82e5\u8981\u4f7f\u7528\u683c\u6797\u5a01\u6cbb\u65f6\u95f4\uff0c\u8bf7\u52a0\u5165\u6b64\u53c2\u6570\uff0chwclock\u4f1a\u6267\u884c\u8f6c\u6362\u7684\u5de5\u4f5c\u3002 <\/td><\/tr>
--version <\/td>\u663e\u793a\u7248\u672c\u4fe1\u606f\u3002 <\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u8bbe\u7f6e\u786c\u4ef6\u65f6\u95f4\u8981\u4f9d\u8d56\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u65f6\u95f4\uff0c\u5177\u4f53\u65b9\u6cd5\u5982\u4e0b\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# hwclock --systohc 
[root@linuxcool ~]# hwclock --systohc \u2013-utc <\/pre>\n\n\n\n


\u5728\u5176\u4ed6\u4e00\u4e9b\u7248\u672c\u7684Linux\uff08\u5982RebHat\uff09\u4e2d\u53ef\u4ee5\u8fd9\u6837\u67e5\u770b\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# cat \/etc\/sysconfig\/clock<\/pre>\n\n\n\n

\u67e5\u770b\u7248\u672c\u4fe1\u606f \uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# hwclock -v <\/pre>\n","protected":false},"excerpt":{"rendered":"

hwclock\u547d\u4ee4\u662f\u4e00\u4e2a\u786c\u4ef6\u65f6\u949f\u8bbf\u95ee\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u663e\u793a\u5f53\u524d\u65f6\u95f4\u3001\u8bbe\u7f6e\u786c\u4ef6\u65f6\u949f\u7684\u65f6\u95f4\u548c\u8bbe\u7f6e\u786c\u4ef6\u65f6\u949f\u4e3a\u7cfb\u7edf\u65f6\u95f4\uff0c\u4e5f\u53ef […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1067"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=1067"}],"version-history":[{"count":31,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1067\/revisions"}],"predecessor-version":[{"id":1545,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1067\/revisions\/1545"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}