{"id":301,"date":"2019-07-22T21:42:49","date_gmt":"2019-07-22T13:42:49","guid":{"rendered":"https:\/\/harson.co\/?p=301"},"modified":"2020-01-06T20:47:49","modified_gmt":"2020-01-06T12:47:49","slug":"lunar-calendar-and-calendar-extrapolate-birth-year","status":"publish","type":"post","link":"https:\/\/harson.co\/index.php\/2019\/07\/22\/lunar-calendar-and-calendar-extrapolate-birth-year\/","title":{"rendered":"Lunar calendar and calendar extrapolate birth year"},"content":{"rendered":"<p>\u4eca\u5929\u901a\u8fc7\u67d0\u4e2a\u4e8b\u60c5\u540e\uff0c\u7a81\u53d1\u5947\u60f3\uff0c\u77e5\u9053\u67d0\u4e2a\u4eba\u7684\u519c\u5386\u548c\u9633\u5386\u751f\u65e5\u540e\uff0c\u662f\u4e0d\u662f\u80fd\u63a8\u7b97\u51fa\u4ed6\u5230\u5e95\u662f\u54ea\u4e00\u5e74\u51fa\u751f\u7684\u5462\uff1f<\/p>\n<p><strong>\u5f53\u7136\u662f\u53ef\u4ee5\u7684\uff01<\/strong><\/p>\n<p>\u519c\u5386\u751f\u65e5\u662f\u5728\u51fa\u751f\u90a3\u4e00\u5e74\u7684\u519c\u5386\u6708\u65e5\uff0c\u800c\u9633\u5386\u751f\u65e5\u4e5f\u662f\u5728\u51fa\u751f\u7684\u90a3\u4e00\u5e74\u7684\u9633\u5386\u6708\u65e5\uff08\u5e9f\u8bdd..\uff09\u4f46\u662f\u6211\u4eec\u5df2\u7ecf\u8fdb\u5165\u4e86\u793e\u4f1a\u4e3b\u4e49\u793e\u4f1a\uff0c\u519c\u8015\u65f6\u4ee3\u65e9\u5df2\u8fc7\u53bb\uff0c\u56e0\u6b64\u6211\u4eec\u6700\u5e38\u7528\u7684\u7eaa\u65e5\u6cd5\u8fd8\u662f\u9633\u5386\u3002<\/p>\n<h1>\u57fa\u672c\u539f\u7406<\/h1>\n<p>\u51fa\u751f\u5e74\u6708\u65e5\u662f\u552f\u4e00\u786e\u5b9a\u7684\uff0c\u7531\u4e8e\u519c\u5386\u548c\u9633\u5386\u7684\u8ba1\u65f6\u6839\u672c\u539f\u7406\u4e0a\u7684\u4e0d\u540c\uff0c\u4f7f\u5f97\u4e8c\u8005\u901a\u5e38\u90fd\u662f\u4e0d\u540c\u6b65\u7684\u3002\u80fd\u591f\u4f7f\u5f97\u4e8c\u8005\u5728\u6570\u503c\u4e0a\u76f8\u7b49\u90fd\u662f\u4e00\u79cd\u5de7\u5408\uff08\u5c0f\u6982\u7387\u4e8b\u4ef6\uff09\u3002\u800c\u51fa\u751f\u65e5\u671f\uff0c\u519c\u5386\u548c\u9633\u5386\u662f\u4e00\u79cd\u552f\u4e00\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u53ea\u9700\u9a8c\u8bc1\u90a3\u4e00\u5e74\u7684\u751f\u65e5\u9633\u5386\u65e5\u671f\u548c\u519c\u5386\u65e5\u671f\u662f\u5426\u90fd\u662f\u5c5e\u4e8e\u540c\u4e00\u4e2a\u81ea\u7136\u65e5\uff0c\u5c31\u53ef\u786e\u5b9a\u4ed6\u662f\u90a3\u4e00\u5e74\u51fa\u751f\u7684\u3002\uff08\u867d\u7136\u540e\u9762\u9a8c\u8bc1\u540e\u624d\u53d1\u73b0\uff0c\u662f\u4e0d\u80fd\u201c\u786e\u5b9a\u201d\u7684\uff09<\/p>\n<h1>\u7a0b\u5e8f\u9a8c\u8bc1\u540e\u7eed<\/h1>\n<p>\u901a\u8fc7\u6d4b\u8bd5\u4e86\u51e0\u7ec4\u6570\u636e\u540e\uff0c\u5176\u5b9e\u8fd9\u6837\u7684\u65e5\u5b50\u6982\u7387\u5728\u51e0\u5341\u5e74\u7684\u7ef4\u5ea6\u4e0a\uff0c\u6982\u7387\u8fd8\u662f\u633a\u5927\u7684\uff08\u4f30\u7b97\u7ea65-10%\uff09\u3002\u4f46\u662f\u6709\u7740\u4e8c\u5341\u5e74\u8fd9\u6837\u7684\u5dee\u8ddd\uff0c\u76f8\u4fe1\u51e1\u662f\u89c1\u8fc7\u672c\u4eba\u7684\uff0c\u90fd\u80fd\u731c\u5230\u662f\u7ed3\u679c\u4e2d\u7684\u54ea\u4e00\u4e2a\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1>Python\u4ee3\u7801<\/h1>\n<p>\u4f9d\u8d56\u5e93\u5b89\u88c5<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">pip install sxtwl<\/code><\/pre>\n<p>\u4f7f\u7528\u8bf4\u660e<\/p>\n<p><a href=\"https:\/\/pypi.org\/project\/sxtwl\/\">https:\/\/pypi.org\/project\/sxtwl\/<\/a><\/p>\n<pre class=\"pure-highlightjs\"><code class=\"\">import sxtwl\r\nlunar = sxtwl.Lunar()\r\n\r\ncnbirth_m = 6\r\ncnbirth_d = 19\r\n#\u519c\u5386\u6708\u65e5\r\nbirth_m = 7\r\nbirth_d = 20\r\n#\u9633\u5386\u6708\u65e5\r\n\r\nfor i in range(1950,2020):\r\n\tcnday = lunar.getDayByLunar(i, cnbirth_m, cnbirth_d)\r\n\t#print(\"Y: \" + str(cnday.y) + \" M: \" + str(cnday.m) + \" D: \" + str(cnday.d))\r\n\tif(cnday.m == birth_m and cnday.d == birth_d):\r\n\t\tprint(i)\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u901a\u8fc7\u67d0\u4e2a\u4e8b\u60c5\u540e\uff0c\u7a81\u53d1\u5947\u60f3\uff0c\u77e5\u9053\u67d0\u4e2a\u4eba\u7684\u519c\u5386\u548c\u9633\u5386\u751f\u65e5\u540e\uff0c\u662f\u4e0d\u662f\u80fd\u63a8\u7b97\u51fa\u4ed6\u5230\u5e95\u662f\u54ea\u4e00\u5e74\u51fa\u751f\u7684\u5462\uff1f \u5f53\u7136\u662f\u53ef\u4ee5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-301","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/comments?post=301"}],"version-history":[{"count":4,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/301\/revisions"}],"predecessor-version":[{"id":431,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/posts\/301\/revisions\/431"}],"wp:attachment":[{"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/media?parent=301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/categories?post=301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harson.co\/index.php\/wp-json\/wp\/v2\/tags?post=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}