{"id":410,"date":"2009-05-22T21:53:00","date_gmt":"2009-05-22T01:53:00","guid":{"rendered":""},"modified":"2013-11-24T21:09:19","modified_gmt":"2013-11-24T13:09:19","slug":"%e8%ae%a1%e7%ae%97%e6%9f%90%e5%a4%a9%e6%98%af%e6%98%9f%e6%9c%9f%e5%87%a0%e7%9a%84%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/410.html","title":{"rendered":"\u8ba1\u7b97\u67d0\u5929\u662f\u661f\u671f\u51e0\u7684\u7b97\u6cd5"},"content":{"rendered":"<p>W= (d+2*m+3*(m+1)\/5+y+y\/4-y\/100+y\/400) mod 7<\/p>\n<p>\u5728\u516c\u5f0f\u4e2dd\u8868\u793a\u65e5\u671f\u4e2d\u7684\u65e5\u671f\uff0cm\u8868\u793a\u6708\u4efd\u6570\uff0cy\u8868\u793a\u5e74\u6570\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u5728\u8be5\u516c\u5f0f\u4e2d\u8981\u628a\u4e00\u6708\u548c\u4e8c\u6708\u770b\u6210\u662f\u4e0a\u4e00\u5e74\u7684\u5341\u4e09\u6708\u548c\u5341\u56db\u6708\uff0c\u4f8b\uff1a\u5982\u679c\u662f2004-1-10\u5219\u6362\u7b97\u6210\uff1a2003-13-10\u6765\u4ee3\u5165\u516c\u5f0f\u8ba1\u7b97\u3002<\/p>\n<p>\u4e0b\u9762\u662f C#\u7684\u4ee3\u7801\u5b9e\u73b0<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n        \/\/\/ \u8ba1\u7b97\u8f93\u5165\u65e5\u671f\u7684\u661f\u671f\r\n        \/\/\/ &lt;\/summary&gt;\r\n        \/\/\/ &lt;param name=&quot;year&quot;&gt;\u5e74\u4efd,yyyy\u683c\u5f0f \u5982\uff1a2009&lt;\/param&gt;\r\n        \/\/\/ &lt;param name=&quot;month&quot;&gt;\u6708\u4efd:1\u523012\u4e4b\u95f4\u7684\u6574\u6570&lt;\/param&gt;\r\n        \/\/\/ &lt;param name=&quot;day&quot;&gt;\u65e5\u671f:1\u523031\u4e4b\u95f4\u7684\u6574\u6570&lt;\/param&gt;\r\n        \/\/\/ &lt;returns&gt;\u661f\u671f\u6570\uff0c1\u81f37\u4e4b\u95f4 1\u4ee3\u8868\u661f\u671f\u4e00\uff0c7\u4ee3\u8868\u661f\u671f\u5929&lt;\/returns&gt;\r\n        int Week(int year, int month, int day) {\r\n\r\n            if (month == 1 || month == 2) {\r\n                month += 12;\r\n                year -= 1;\r\n            }\r\n\r\n            int week = (day + 2 * month  + 3 * (month + 1) \/ 5 + year + year \/ 4 - year \/ 100 + year \/ 400) % 7;\r\n            return (week + 1);\r\n        }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>W= (d+2*m+3*(m+1)\/5+y+y\/4-y\/100+y\/400) mod 7 \u5728\u516c\u5f0f\u4e2dd\u8868\u793a\u65e5\u671f\u4e2d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-410","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=410"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/410\/revisions"}],"predecessor-version":[{"id":5192,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/410\/revisions\/5192"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}