{"id":707,"date":"2019-04-25T11:36:25","date_gmt":"2019-04-25T03:36:25","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=707"},"modified":"2022-05-11T17:00:27","modified_gmt":"2022-05-11T09:00:27","slug":"date","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/date","title":{"rendered":"date\u547d\u4ee4 – \u663e\u793a\u6216\u8bbe\u7f6e\u7cfb\u7edf\u65e5\u671f\u4e0e\u65f6\u95f4"},"content":{"rendered":"\n

date\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcd\u7684\u65f6\u95f4\u3001\u65f6\u949f\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u663e\u793a\u6216\u8bbe\u7f6e\u7cfb\u7edf\u65e5\u671f\u4e0e\u65f6\u95f4\u4fe1\u606f\u3002\u8fd0\u7ef4\u4eba\u5458\u53ef\u4ee5\u6839\u636e\u60f3\u8981\u7684\u683c\u5f0f\u6765\u8f93\u51fa\u7cfb\u7edf\u65f6\u95f4\u4fe1\u606f\uff0c\u65f6\u95f4\u683c\u5f0fMMDDhhmm[CC][YY][.ss]\uff0c\u5176\u4e2d MM \u4e3a\u6708\u4efd\uff0cDD \u4e3a\u65e5\uff0chh \u4e3a\u5c0f\u65f6\uff0cmm \u4e3a\u5206\u949f\uff0cCC \u4e3a\u5e74\u4efd\u524d\u4e24\u4f4d\u6570\u5b57\uff0cYY \u4e3a\u5e74\u4efd\u540e\u4e24\u4f4d\u6570\u5b57\uff0css \u4e3a\u79d2\u6570\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>date [\u9009\u9879] [+\u8f93\u51fa\u5f62\u5f0f] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-d datestr <\/td>\u663e\u793a datestr \u4e2d\u6240\u8bbe\u5b9a\u7684\u65f6\u95f4 (\u975e\u7cfb\u7edf\u65f6\u95f4) <\/td><\/tr>
-s datestr <\/td>\u5c06\u7cfb\u7edf\u65f6\u95f4\u8bbe\u4e3a datestr \u4e2d\u6240\u8bbe\u5b9a\u7684\u65f6\u95f4 <\/td><\/tr>
-u <\/td>\u663e\u793a\u76ee\u524d\u7684\u683c\u6797\u5a01\u6cbb\u65f6\u95f4 <\/td><\/tr>
--help <\/td>\u663e\u793a\u5e2e\u52a9\u4fe1\u606f <\/td><\/tr>
--version <\/td>\u663e\u793a\u7248\u672c\u7f16\u53f7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u4ee5\u9ed8\u8ba4\u683c\u5f0f\u8f93\u51fa\u7cfb\u7edf\u5f53\u524d\u7684\u65e5\u671f\u4e0e\u65f6\u95f4\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# date<\/strong>\nThu May 11 09:14:35 CST 2022<\/pre>\n\n\n\n

\u6309\u7167\u201c\u5e74-\u6708-\u65e5\u201d\u7684\u6307\u5b9a\u683c\u5f0f\u8f93\u51fa\u7cfb\u7edf\u5f53\u524d\u7684\u65e5\u671f\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# date \"+%Y-%m-%d\"<\/strong>\r\n2022-05-11\r<\/pre>\n\n\n\n

\u6309\u7167\u201c\u5c0f\u65f6:\u5206\u949f:\u79d2\u201d\u7684\u6307\u5b9a\u683c\u5f0f\u8f93\u51fa\u7cfb\u7edf\u5f53\u524d\u7684\u65f6\u95f4\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# date \"%H:%M:%S\"<\/strong>\n09:14:35<\/pre>\n\n\n\n

\u8bbe\u7f6e\u5f53\u524d\u7cfb\u7edf\u4e3a\u6307\u5b9a\u7684\u65e5\u671f\u548c\u65f6\u95f4\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# date -s \"20221101 8:30:00\" <\/strong>\nSun Nov 1 08:30:00 CST 2022<\/pre>\n","protected":false},"excerpt":{"rendered":"

date\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcd\u7684\u65f6\u95f4\u3001\u65f6\u949f\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u663e\u793a\u6216\u8bbe\u7f6e\u7cfb\u7edf\u65e5\u671f\u4e0e\u65f6\u95f4\u4fe1\u606f\u3002\u8fd0\u7ef4\u4eba\u5458\u53ef\u4ee5\u6839\u636e\u60f3\u8981\u7684\u683c\u5f0f\u6765 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/707"}],"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=707"}],"version-history":[{"count":11,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/707\/revisions"}],"predecessor-version":[{"id":9508,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/707\/revisions\/9508"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}