{"id":819,"date":"2025-07-27T10:00:52","date_gmt":"2025-07-27T02:00:52","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=819"},"modified":"2025-07-27T10:00:52","modified_gmt":"2025-07-27T02:00:52","slug":"dazy%ef%bc%9a-%e8%bd%bb%e6%9d%be%e5%a4%84%e7%90%86%e5%92%8c%e8%bd%ac%e6%8d%a2%e6%97%a5%e6%9c%9f%e6%97%b6%e9%97%b4%e6%a0%bc%e5%bc%8f%e7%9a%84%e5%88%a9%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/819.html","title":{"rendered":"Dazy\uff1a \u8f7b\u677e\u5904\u7406\u548c\u8f6c\u6362\u65e5\u671f\u65f6\u95f4\u683c\u5f0f\u7684\u5229\u5668"},"content":{"rendered":"<p><h2>\u7b80\u4ecb<\/h2>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/F7M7aDBdj.jpg\" alt=\"Dazy\uff1a \u8f7b\u677e\u5904\u7406\u548c\u8f6c\u6362\u65e5\u671f\u65f6\u95f4\u683c\u5f0f\u7684\u5229\u5668\" title=\"Dazy\uff1a \u8f7b\u677e\u5904\u7406\u548c\u8f6c\u6362\u65e5\u671f\u65f6\u95f4\u683c\u5f0f\u7684\u5229\u5668\"><\/p>\n<p><p>Dazy\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u5904\u7406\u548c\u8f6c\u6362\u65e5\u671f\u548c\u65f6\u95f4\u683c\u5f0f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Dazy\uff0c\u5305\u62ec\u64cd\u4f5c\u6b65\u9aa4\u3001\u547d\u4ee4\u793a\u4f8b\u53ca\u5176\u89e3\u91ca\u3002<\/p>\n<\/p>\n<p><h2>\u5b89\u88c5Dazy<\/h2>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4f7f\u7528Dazy\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86Dazy\u3002\u4ee5\u4e0b\u662f\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5Dazy\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>macOS:<\/strong><\/p>\n<p><pre><code>brew install dazy<\/code><\/pre>\n<\/p>\n<\/li>\n<li><strong>Linux:<\/strong><\/p>\n<p><pre><code>sudo apt-get install dazy<\/code><\/pre>\n<\/p>\n<\/li>\n<li><strong>Windows:<\/strong><\/p>\n<p><p>\u8bbf\u95eeDazy\u7684GitHub\u9875\u9762\uff08https:\/\/github.com\/mattbaker\/dazy\uff09\uff0c\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684Windows\u5b89\u88c5\u7a0b\u5e8f\u5e76\u5b89\u88c5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h2>\u57fa\u672c\u4f7f\u7528<\/h2>\n<\/p>\n<p><h3>\u8f6c\u6362\u65e5\u671f\u683c\u5f0f<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528`date`\u547d\u4ee4\u53ef\u4ee5\u5c06\u4e00\u4e2a\u65e5\u671f\u4ece\u4e00\u79cd\u683c\u5f0f\u8f6c\u6362\u4e3a\u53e6\u4e00\u79cd\u683c\u5f0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code>date -d '2022-12-31' '+%Y-%m-%d'<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06`2022-12-31`\u4eceISO\u683c\u5f0f\u8f6c\u6362\u4e3a`%Y-%m-%d`\u683c\u5f0f\uff0c\u8f93\u51fa\u4e3a`2022-12-31`\u3002<\/p>\n<\/p>\n<p><h3>\u8f6c\u6362\u65f6\u95f4\u683c\u5f0f<\/h3>\n<\/p>\n<p><p>\u4e0e\u65e5\u671f\u7c7b\u4f3c\uff0c\u53ef\u4ee5\u4f7f\u7528`time`\u547d\u4ee4\u5c06\u65f6\u95f4\u4ece\u4e00\u79cd\u683c\u5f0f\u8f6c\u6362\u4e3a\u53e6\u4e00\u79cd\u683c\u5f0f\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code>time -d '2022-12-31 23:59:59' '+%Y-%m-%d %H:%M:%S'<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e2a\u547d\u4ee4\u5c06`2022-12-31 23:59:59`\u4eceISO\u683c\u5f0f\u8f6c\u6362\u4e3a`%Y-%m-%d %H:%M:%S`\u683c\u5f0f\uff0c\u8f93\u51fa\u4e3a`2022-12-31 23:59:59`\u3002<\/p>\n<\/p>\n<p><h3>\u683c\u5f0f\u5316\u65e5\u671f\u548c\u65f6\u95f4<\/h3>\n<\/p>\n<p><p>Dazy\u8fd8\u63d0\u4f9b\u4e86`format`\u547d\u4ee4\uff0c\u7528\u4e8e\u5c06\u65e5\u671f\u548c\u65f6\u95f4\u683c\u5f0f\u5316\u4e3a\u5b57\u7b26\u4e32\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code>format --date '2022-12-31' --format '%Y\u5e74%m\u6708%d\u65e5'<\/p>\r\n<p>format --time '23:59:59' --format '\u65f6:mm:ss'<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code>2022\u5e7412\u670831\u65e5<\/p>\r\n<p>\u65f6:23:59:59<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u9ad8\u7ea7\u64cd\u4f5c<\/h2>\n<\/p>\n<p><h3>\u8ba1\u7b97\u65e5\u671f\u5dee\u5f02<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528`diff`\u547d\u4ee4\u53ef\u4ee5\u8ba1\u7b97\u4e24\u4e2a\u65e5\u671f\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code>diff --from='2022-01-01' --to='2022-01-10' --unit=d --format='%a %b %d'<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code>7 days<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u751f\u6210\u65e5\u671f\u8303\u56f4<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528`range`\u547d\u4ee4\u53ef\u4ee5\u751f\u6210\u4e00\u4e2a\u65e5\u671f\u8303\u56f4\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code>range --start='2022-01-01' --end='2022-01-10' --step=1 --format='%Y-%m-%d'<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u4e3a\uff1a<\/p>\n<\/p>\n<p><pre><code>2022-01-01<\/p>\r\n<p>2022-01-02<\/p>\r\n<p>2022-01-03<\/p>\r\n<p>...<\/p>\r\n<p>2022-01-10<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u6ce8\u610f\u4e8b\u9879<\/h2>\n<\/p>\n<ul>\n<li>\u5728\u4f7f\u7528Dazy\u65f6\uff0c\u786e\u4fdd\u60a8\u4f7f\u7528\u6b63\u786e\u7684\u65e5\u671f\u548c\u65f6\u95f4\u683c\u5f0f\u3002<\/li>\n<li>\u5728\u6267\u884c\u8ba1\u7b97\u65e5\u671f\u5dee\u5f02\u548c\u751f\u6210\u65e5\u671f\u8303\u56f4\u7684\u64cd\u4f5c\u65f6\uff0c\u8bf7\u6ce8\u610f\u6b65\u957f\u53c2\u6570\u7684\u9009\u62e9\u3002<\/li>\n<li>\u5982\u679c\u60a8\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u8bf7\u53c2\u8003Dazy\u7684\u5b98\u65b9\u6587\u6863\u6216\u8054\u7cfb\u652f\u6301\u56e2\u961f\u3002<\/li>\n<\/ul>\n<p><h2>\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u53ef\u4ee5\u4f7f\u7528\u7ba1\u9053\u5c06Dazy\u7684\u8f93\u51fa\u4f20\u9012\u7ed9\u5176\u4ed6\u547d\u4ee4\uff0c\u4f8b\u5982`date | tr -s &#8216; &#8216; &#8216;-&#8216; | dazy format &#8211;format &#8216;%Y-%m-%d&#8217;`\u3002<\/li>\n<li>\u5982\u679c\u60a8\u9700\u8981\u5c06\u65e5\u671f\u548c\u65f6\u95f4\u8f6c\u6362\u4e3a\u5176\u4ed6\u65f6\u533a\uff0c\u53ef\u4ee5\u4f7f\u7528`date`\u547d\u4ee4\u7684`-u`\u9009\u9879\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb Dazy\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u5904\u7406\u548c\u8f6c\u6362\u65e5\u671f\u548c\u65f6\u95f4\u683c\u5f0f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Dazy\uff0c\u5305\u62ec\u64cd\u4f5c\u6b65\u9aa4\u3001\u547d\u4ee4\u793a\u4f8b\u53ca\u5176\u89e3\u91ca\u3002 \u5b89\u88c5Dazy \u5728\u5f00\u59cb\u4f7f\u7528Dazy\u4e4b\u524d\uff0c\u9700\u8981\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86Dazy\u3002\u4ee5\u4e0b\u662f\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5Da&#8230;<\/p>\n","protected":false},"author":1,"featured_media":820,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[332,333,266],"topic":[],"class_list":["post-819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hk-server","tag-dazy","tag-333","tag-266"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=819"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/819\/revisions"}],"predecessor-version":[{"id":822,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/819\/revisions\/822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/820"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=819"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}