{"id":1493,"date":"2009-01-07T18:44:21","date_gmt":"2009-01-07T22:44:21","guid":{"rendered":"http:\/\/blogs.n1zyy.com\/n1zyy\/?p=1493"},"modified":"2009-01-07T18:44:21","modified_gmt":"2009-01-07T22:44:21","slug":"using-datemanip","status":"publish","type":"post","link":"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/01\/07\/using-datemanip\/","title":{"rendered":"Using Date::Manip"},"content":{"rendered":"<p>Here&#8217;s a quick code sample to loop over the dates in a range with Perl&#8217;s Date::Manip. The documentation is voluminous and yet I found it difficult to understand; for people who learn best by example, here goes:<\/p>\n<pre>\nuse Date::Manip;\n\n#                    Y M W DDD MS?    'base'       'start'      'end' \n#@dates = ParseRecur(\"0:0:0:1*1:0:0\",\"12\/1\/08\",\"12\/1\/08\",\"1\/7\/09\") ;\n@dates = ParseRecur(\"0:0:0:1*1:0:0\",\"1 month ago\", \"1 month ago\", \"today\");\n\nforeach my $date ( @dates )   {\n        #printf qq|%sn|, &UnixDate($date, \"%B %d, %Y\");\n        printf qq|%sn|, &UnixDate($date, \"%D\");\n}\n<\/pre>\n<p>The date formats (%B, %d, %D, etc.) are consistent with those documented in the <tt>date<\/tt> manpage.<\/p>","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a quick code sample to loop over the dates in a range with Perl&#8217;s Date::Manip. The documentation is voluminous and yet I found it difficult to understand; for people who learn best by example, here goes: use Date::Manip; # &hellip; <a href=\"https:\/\/blogs.n1zyy.com\/n1zyy\/2009\/01\/07\/using-datemanip\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1493","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/1493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/comments?post=1493"}],"version-history":[{"count":0,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/posts\/1493\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/media?parent=1493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/categories?post=1493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.n1zyy.com\/n1zyy\/wp-json\/wp\/v2\/tags?post=1493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}