{"id":18208,"date":"2024-11-18T11:50:16","date_gmt":"2024-11-18T03:50:16","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18208\/"},"modified":"2024-11-18T11:50:16","modified_gmt":"2024-11-18T03:50:16","slug":"linux%e7%b3%bb%e7%bb%9f%e6%97%b6%e9%97%b4%e6%80%8e%e4%b9%88%e8%8e%b7%e5%8f%96","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18208\/","title":{"rendered":"linux\u7cfb\u7edf\u65f6\u95f4\u600e\u4e48\u83b7\u53d6"},"content":{"rendered":"<blockquote><p>\n  \u5728 linux \u7cfb\u7edf\u4e2d\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528 date \u547d\u4ee4\u76f4\u63a5\u8f93\u51fa\u5f53\u524d\u65f6\u95f4\u3002\u4f7f\u7528 date +%s \u547d\u4ee4\u83b7\u53d6 unix \u65f6\u95f4\u6233\u3002\u4f7f\u7528 date +% \u9009\u9879\u6307\u5b9a\u7279\u5b9a\u683c\u5f0f\u7684\u65f6\u95f4\u3002\u4f7f\u7528 date \u547d\u4ee4\u7684 -u \u548c -z \u9009\u9879\u83b7\u53d6\u5176\u4ed6\u65f6\u533a\u7684\u65f6\u95f4\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/04\/2024060413571748319.jpg\" class=\"aligncenter\" title=\"linux\u7cfb\u7edf\u65f6\u95f4\u600e\u4e48\u83b7\u53d6\u63d2\u56fe\" alt=\"linux\u7cfb\u7edf\u65f6\u95f4\u600e\u4e48\u83b7\u53d6\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u83b7\u53d6 Linux \u7cfb\u7edf\u65f6\u95f4<\/strong><\/p>\n<p>\u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u8fd9\u53d6\u51b3\u4e8e\u6240\u9700\u7684\u7cbe\u5ea6\u548c\u683c\u5f0f\u3002<\/p>\n<p><strong>\u76f4\u63a5\u8f93\u51fa\u5f53\u524d\u65f6\u95f4<\/strong><\/p>\n<p>\u8981\u76f4\u63a5\u8f93\u51fa\u5f53\u524d\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528 date \u547d\u4ee4\uff1a<\/p>\n<pre>date<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u8f93\u51fa\u7c7b\u4f3c\u4ee5\u4e0b\u683c\u5f0f\u7684\u5f53\u524d\u65f6\u95f4\uff1a<\/p>\n<pre>Tue Apr 12 14:31:23 CST 2023<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u83b7\u53d6 UNIX \u65f6\u95f4\u6233<\/strong><\/p>\n<p>UNIX \u65f6\u95f4\u6233\u662f\u81ea 1970 \u5e74 1 \u6708 1 \u65e5\u5348\u591c (UTC) \u4ee5\u6765\u7ecf\u8fc7\u7684\u79d2\u6570\u3002\u8981\u83b7\u53d6 UNIX \u65f6\u95f4\u6233\uff0c\u53ef\u4ee5\u4f7f\u7528 date +%s \u547d\u4ee4\uff1a<\/p>\n<pre>date +%s<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u8f93\u51fa\u4e00\u4e2a\u6570\u5b57\uff0c\u8868\u793a\u5f53\u524d\u65f6\u95f4\u4ee5 UNIX \u65f6\u95f4\u6233\u8868\u793a\u3002<\/p>\n<p><strong>\u83b7\u53d6\u7279\u5b9a\u683c\u5f0f\u7684\u65f6\u95f4<\/strong><\/p>\n<p>\u8981\u83b7\u53d6\u7279\u5b9a\u683c\u5f0f\u7684\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528 date \u547d\u4ee4\u7684 +% \u9009\u9879\u3002\u4f8b\u5982\uff0c\u8981\u83b7\u53d6 ISO 8601 \u683c\u5f0f\u7684\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre>date +%Y-%m-%dT%H:%M:%SZ<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u8f93\u51fa\u7c7b\u4f3c\u4ee5\u4e0b\u683c\u5f0f\u7684\u65f6\u95f4\uff1a<\/p>\n<pre>2023-04-12T14:31:23Z<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u83b7\u53d6\u5176\u4ed6\u65f6\u533a\u7684\u65f6\u95f4<\/strong><\/p>\n<p>\u8981\u83b7\u53d6\u5176\u4ed6\u65f6\u533a\u7684\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528 date \u547d\u4ee4\u7684 -u \u548c -z \u9009\u9879\u3002\u4f8b\u5982\uff0c\u8981\u83b7\u53d6\u7f8e\u56fd\u4e1c\u90e8\u65f6\u95f4\u7684\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<pre>date -u -z America\/New_York<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u8f93\u51fa\u7c7b\u4f3c\u4ee5\u4e0b\u683c\u5f0f\u7684\u65f6\u95f4\uff1a<\/p>\n<pre>Tue Apr 12 10:31:23 EDT 2023<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7cfb\u7edf\u65f6\u95f4\u600e\u4e48\u83b7\u53d6\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 linux \u7cfb\u7edf\u4e2d\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff1a\u4f7f\u7528 date \u547d\u4ee4\u76f4\u63a5\u8f93\u51fa\u5f53\u524d\u65f6\u95f4\u3002\u4f7f\u7528 date +%s \u547d\u4ee4\u83b7\u53d6 unix \u65f6\u95f4\u6233\u3002\u4f7f\u7528 date +% \u9009\u9879\u6307\u5b9a\u7279\u5b9a\u683c\u5f0f\u7684\u65f6\u95f4\u3002\u4f7f\u7528 date \u547d\u4ee4\u7684 -u \u548c -z \u9009\u9879\u83b7\u53d6\u5176\u4ed6\u65f6\u533a\u7684\u65f6\u95f4\u3002 \u5982\u4f55\u83b7\u53d6 Linux \u7cfb\u7edf\u65f6\u95f4 \u5728 Linux \u7cfb\u7edf\u4e2d\uff0c\u83b7\u53d6\u7cfb\u7edf\u65f6\u95f4\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u8fd9\u53d6\u51b3\u4e8e\u6240\u9700\u7684\u7cbe\u5ea6\u548c\u683c\u5f0f\u3002 \u76f4\u63a5\u8f93\u51fa\u5f53\u524d\u65f6\u95f4 \u8981\u76f4\u63a5\u8f93\u51fa\u5f53\u524d\u65f6\u95f4\uff0c\u53ef\u4ee5\u4f7f\u7528 date \u547d\u4ee4\uff1a date \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u8f93\u51fa\u7c7b\u4f3c\u4ee5\u4e0b\u683c\u5f0f\u7684\u5f53\u524d\u65f6\u95f4\uff1a Tue Apr 12 14:31:23 CST 2023 \u767b\u5f55\u540e\u590d\u5236 \u83b7\u53d6 UNIX \u65f6\u95f4\u6233 UNIX \u65f6\u95f4\u6233\u662f\u81ea 1970 \u5e74 1 \u6708 1 \u65e5\u5348\u591c (UTC) \u4ee5\u6765\u7ecf\u8fc7\u7684\u79d2\u6570\u3002\u8981\u83b7\u53d6 UNIX \u65f6\u95f4\u6233\uff0c\u53ef\u4ee5\u4f7f\u7528 date [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18208","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18208"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18208\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}