{"id":267493,"date":"2023-03-20T22:02:06","date_gmt":"2023-03-20T14:02:06","guid":{"rendered":"https:\/\/lrxjmw.cn\/xgrqxyxgxtrq.html"},"modified":"2023-03-20T22:02:06","modified_gmt":"2023-03-20T14:02:06","slug":"xgrqxyxgxtrq","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/xgrqxyxgxtrq.html","title":{"rendered":"\u4fee\u6539\u65e5\u671f\u60f3\u8981\u4fee\u6539\u7cfb\u7edf\u65e5\u671f\uff0c\u4f60\u5e94\u8be5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4"},"content":{"rendered":"

timedatectl\u662f\u62ff\u6765\u67e5\u8be2\u548c\u66f4\u6539\u7cfb\u7edf<\/a>\u65f6\u95f4\u548c\u914d\u7f6e\u7684Linux<\/a>\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u662fsystemd\u7cfb\u7edf\u670d\u52a1\u7ba1\u7406\u7684\u4e00\u90e8\u4efd\uff0c\u800c\u4e14\u5bb9\u8bb8\u4f60\u68c0\u6d4b\u548c\u66f4\u6539\u7cfb\u7edf\u65f6\u949f\u7684\u914d\u7f6e\u3002<\/p>\n

\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u6d89\u53ca\u8be5\u7cbe\u5de7\u4f46\u975e\u5e38\u91cd\u8981\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u65b9\u9762\u3002<\/p>\n

windows\u540c\u6b65linux\u65f6\u95f4_\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux_linux\u540c\u6b65ntp\u670d\u52a1\u5668\u65f6\u95f4<\/p>\n

\u7cfb\u7edf\u5f53\u524d\u7684\u65f6\u95f4\u72b6\u6001<\/p>\n

\u60f3\u8981\u67e5\u770b\u7cfb\u7edf\u5f53\u524d\u65e5\u671f\/\u65f6\u95f4\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux<\/strong>\uff0c\u4ee5\u53ca\u53ef\u4f7f\u7528\u4e0d\u5e26\u4efb\u4f55\u53c2\u6570\u7684\u547d\u4ee4<\/a>\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u914d\u7f6e\uff0c\u53ef\u4ee5\u8fd9\u6837\uff1a<\/p>\n

\n

# timedatectl\n<\/pre>\n<\/p>\n

\u8f93\u5165\u7684\u7ed3\u679c\u5982\u540c\u8fd9\u6837\uff1a<\/p>\n

\u66f4\u6539\u65e5\u671f<\/p>\n

\u60f3\u8981\u66f4\u6539\u7cfb\u7edf\u65e5\u671f\uff0c\u4f60\u53ef\u4ee5\u7b80\u5355\u5730\u4f7f\u7528timedatectl\u8bbe\u7f6e\u65f6\u95f4\u547d\u4ee4\uff0c\u7d27\u8ddf\u547d\u4ee4\u7684\u662fYYYY-MM-DD\u683c\u5f0f\u7684\u65e5\u671f\uff0cYYYY\u4ee3\u8868\u5e74\uff0cMM\u4ee3\u88682\u4f4d\u6570\u5b57\u7684\u6708\u4efd\uff0cDD\u4ee3\u88682\u4f4d\u6570\u5b57\u7684\u5929\u3002\u4e3e\u4e2a\u4e8b\u4f8b\uff0c\u5047\u5982\u4f60\u60f3\u628a\u65e5\u671f\u6539\u4e3a2015\u5e742\u67084\u53f7,\u4f60\u5e94\u5f53\u4f7f\u7528\u4e0b\u8fb9\u7684\u547d\u4ee4\uff1a<\/p>\n

\n

# timedatectl 2015-02-04\n<\/pre>\n<\/p>\n

\u66f4\u6539\u65f6\u95f4<\/p>\n

\u60f3\u8981\u66f4\u6539\u65f6\u95f4\uff0c\u4f60\u53ef\u4ee5\u4ee5\u76f8\u540c\u7684\u65b9\u6cd5\u4f7f\u7528\u8be5\u5de5\u5177\uff0c\u5e76\u4e14\u4f7f\u7528\u7684\u683c\u5f0f\u4e3aHH:MM:SS\u7ea2\u65d7linux5.0\uff0cHH\u4ee3\u886824\u5c0f\u65f6\u5236\u7684\u65f6\u949f\uff0cMM\u4ee3\u8868\u5206\u949f\uff0cSS\u4ee3\u8868\u79d2\u949f\u3002\u60f3\u5c06\u5f53\u524d\u65f6\u95f4\u8bbe\u4e3a22:04:43\uff0c\u4f7f\u7528\u4e0b\u8fb9\u7684\u547d\u4ee4\uff1a<\/p>\n

\n

# timedatectl 22:04:43\n<\/pre>\n<\/p>\n

\u66f4\u6539\u65f6\u533a<\/p>\n

\u8bbe\u7f6e\u6b63\u786e\u7684\u65f6\u533a\u662f\u4fdd\u6301\u65f6\u95f4\u540c\u6b65\u7684\u5173\u952e\uff0c\u975e\u5e38\u662f\u5728\u4f60\u4f7f\u7528NTP\u5408\u540c\u540c\u6b65\u7684\u65f6\u4faf\u3002\u9996\u5148\uff0c\u4f60\u5e94\u5f53\u4f7f\u7528list-timezones\u9009\u9879\u5217\u4e3e\u4f60\u6240\u5728\u533a\u57df\u7684\u53ef\u7528\u65f6\u533a\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528grep\u548cmore\u6765\u8ba9\u683c\u5f0f\u4fbf\u6377\u9605\u8bfb\uff1a<\/p>\n

\n

# timedatectl list-timezones | grep America | more\n<\/pre>\n<\/p>\n

linux\u540c\u6b65ntp\u670d\u52a1\u5668\u65f6\u95f4_\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux_windows\u540c\u6b65linux\u65f6\u95f4<\/p>\n

\u8fd9\u5c06\u663e\u793a\u4e00\u4e2a\u7b80\u5355\u7684\u6eda\u52a8\u5217\u8868\u683c\u5f0f\u3002<\/p>\n

\u4ee5\u540elinux web\u670d\u52a1\u5668\uff0c\u4f60\u8fd8\u4f1a\u6653\u5f97\u4f60\u60f3\u8bbe\u7f6e\u7684\u65f6\u533a\u662f\u600e\u6837\u547d\u540d\u7684\uff0c\u4e4b\u540e\u4f7f\u7528\u4e0b\u8fb9\u7684\u547d\u4ee4\u66f4\u6539\u5b83\uff1a<\/p>\n

\n

# timedatectl set-timezone America\/Los_Angeles\n<\/pre>\n<\/p>\n

\u8bbe\u7f6e\u672c\u5730\u65f6\u949f<\/p>\n

\u5b9e\u65f6\u65f6\u949f\uff08RTC\uff09\uff0c\u4e00\u822c\u88ab\u79f0\u4e3a\u786c\u4ef6\u65f6\u949f\uff0c\u5b8c\u5168\u72ec\u7acb\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u5f53\u524d\u72b6\u6001\uff0c\u751a\u81f3\u53ef\u4ee5\u5728\u8ba1\u7b97\u673a\u5173\u6389\u7684\u65f6\u4faf\u5de5\u4f5c\u3002\u4f60\u53ef\u4ee5\u914d\u7f6e\u7cfb\u7edf\u4f7f\u7528\u56fd\u9645\u65f6\u95f4\uff08UTC\uff09\u6216\u5f53\u5730\u65f6\u95f4\u6765\u6821\u51c6RTC\u3002\u6ce8\u610f\uff0c\u4f7f\u7528\u5f53\u5730\u65f6\u533a\u6821\u51c6RTC\u5e76\u6ca1\u6709\u5b8c\u7f8e\u652f\u6301\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux<\/strong>\uff0c\u5e76\u4e14\u8fd8\u6709\u53ef\u80fd\u7531\u4e8e\u65f6\u533a\u53d8\u5316\u548c\u590f\u4ee4\u65f6\u8c03\u6574\u5bfc\u81f4\u8bb8\u591a\u95ee\u9898\u3002\u5047\u5982\u6709\u53ef\u80fd\uff0c\u5728UTC\u6a21\u5f0f\u4e0b\u6821\u51c6RTC\u3002\u8fd9\u4e00\u505a\u6cd5\u7684\u60df\u4e00\u95ee\u9898\u662f\uff0c\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u53ef\u80fd\u4e0d\u5b8c\u5168\u652f\u6301\u5b83\uff08\u5047\u5982\u4f60\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u8fd0\u884c2\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u7684\u8bdd\uff09\u3002<\/p>\n

\u4f7f\u7528UTC\u6a21\u5f0f\u6821\u51c6RTC\uff0c\u4f7f\u7528\u4e0b\u8fb9\u7684\u547d\u4ee4\uff1a<\/p>\n

\n

# timedatectl set-local-rtc 0\n<\/pre>\n<\/p>\n

\u4f7f\u7528\u5f53\u5730\u65f6\u95f4\u6821\u51c6\uff0c\u4f7f\u7528\uff1a<\/p>\n

\n

# timedatectl set-local-rtc 1\n<\/pre>\n<\/p>\n

\u8bbe\u7f6eNTP\u540c\u6b65<\/p>\n

linux\u540c\u6b65ntp\u670d\u52a1\u5668\u65f6\u95f4_windows\u540c\u6b65linux\u65f6\u95f4_\u540c\u6b65\u65f6\u95f4\u670d\u52a1\u5668 linux<\/p>\n

\u7f51\u8def\u65f6\u95f4\u5408\u540c\uff08NTP\uff09\u662f\u5728\u5206\u7ec4\u4ea4\u6362\u3001\u53ef\u53d8\u6570\u636e\u5ef6\u540e\u7684\u8ba1\u7b97\u673a\u7cfb\u7edf\u95f4\u8fdb\u884c\u65f6\u949f\u540c\u6b65\u7684\u7f51\u8def\u5408\u540c\u3002NTP\u88ab\u8bbe\u8ba1\u4f7f\u7528\u51e0\u5fae\u79d2\u7684\u534f\u8c03\u901a\u7528\u65f6\u95f4\uff08UTC\uff09\u6765\u540c\u6b65\u6240\u6709\u53c2\u4e0e\u7684\u8ba1\u7b97\u673a\u3002\u5047\u5982\u4f60\u5e0c\u671b\u8bbe\u7f6eNTP\u540c\u6b65\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528set-ntp\u9009\u9879\u8bbe\u7f6e\u3002\u4f7f\u7528\u201cno\u201d\u5173\u95edNTP\u540c\u6b65\uff0c\u4f7f\u7528\u201cyes\u201d\u5f00\u542f\u3002<\/p>\n

\n

# timedatectl set-ntp yes\n<\/pre>\n<\/p>\n

\u4f5c\u8005\uff1aAdrianDinu\u8bd1\u8005\uff1asu-kaiyao\u6821\u5bf9\uff1awxy<\/p>\n

\u672c\u6587\u7531LCTT\u539f\u521b\u7ffb\u8bd1\uff0cLinux\u4e2d\u56fd\u8363\u8a89\u63a8\u51fa<\/p>\n

\u8bd1\u8005\uff1asu-kaiyao<\/p>\n

\u672c\u6587\u662f\u539f\u521b\u6295\u9012\u6216\u7ffb\u8bd1\u6295\u9012\uff0cLinux\u4e2d\u56fd\u9996\u53d1\u5730\u5740\uff1a<\/p>\n

\u6b22\u8fce\u8f6c\u8f7d\uff0c\u656c\u8bf7\u5728\u6b63\u6587\u4e2d\u6807\u660e\u5e76\u4fdd\u7559\u539f\u6587\/\u8bd1\u6587\u94fe\u63a5\u548c\u4f5c\u8005\/\u8bd1\u8005\u7b49\u4fe1\u606f<\/p>\n","protected":false},"excerpt":{"rendered":"

timedatectl\u662f\u7528\u6765\u67e5\u8be2\u548c\u4fee\u6539\u7cfb\u7edf\u65f6\u95f4\u548c\u914d\u7f6e\u7684Linux\u5e94\u7528\u7a0b\u5e8f\u3002\u7cfb\u7edf\u670d\u52a1\u7ba1\u7406\u7684\u4e00\u90e8\u5206\uff0c\u5e76\u4e14\u5141\u8bb8\u4f60\u68c0\u67e5\u548c\u4fee\u6539\u7cfb\u7edf\u65f6\u949f\u7684\u914d\u7f6e\u3002\u60f3\u8981\u67e5\u770b\u7cfb\u7edf\u5f53\u524d\u65e5\u671f\/\u65f6\u95f4\uff0c\u4ee5\u53ca\u53ef\u4f7f\u7528\u4e0d\u5e26\u4efb\u4f55\u53c2\u6570\u7684\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u65f6\u95f4\u914d\u7f6e\uff0c\u53ef\u4ee5\u8fd9\u6837\uff1a\u5b9e\u65f6\u65f6\u949f\uff08RTC\uff09\uff0c\u901a\u5e38\u88ab\u79f0\u4e3a\u786c\u4ef6\u65f6\u949f\uff0c\u5b8c\u5168\u72ec\u7acb\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u5f53\u524d\u72b6\u6001\uff0c\u751a\u81f3\u53ef\u4ee5\u5728\u8ba1\u7b97\u673a\u5173\u95ed\u7684\u65f6\u5019\u5de5\u4f5c\u3002NTP\u88ab\u8bbe\u8ba1\u4f7f\u7528\u51e0\u6beb\u79d2\u7684\u534f\u8c03\u901a\u7528\u65f6\u95f4\uff08UTC\uff09\u6765\u540c\u6b65\u6240\u6709\u53c2\u4e0e\u7684\u8ba1\u7b97\u673a\u3002<\/p>\n","protected":false},"author":1,"featured_media":267494,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-267493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/267493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=267493"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/267493\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/267494"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=267493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=267493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=267493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}