{"id":2199,"date":"2013-04-01T05:06:42","date_gmt":"2013-03-31T20:06:42","guid":{"rendered":"http:\/\/auctionpro.co.kr\/?p=2199"},"modified":"2022-03-29T20:58:00","modified_gmt":"2022-03-29T11:58:00","slug":"c-%eb%82%a0%ec%a7%9c-%eb%b9%84%ea%b5%90-%eb%8b%ac%ea%b5%ac%ed%95%98%ea%b8%b0-months-count","status":"publish","type":"post","link":"https:\/\/www.auctionpro.co.kr\/?p=2199","title":{"rendered":"C# \ub0a0\uc9dc \ube44\uad50 \ub2ec\uc218 \uad6c\ud558\uae30 Months count"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\ub450 \ub0a0\uc9dc \ube44\uad50\ud574\uc11c \ub2ec\uc218 \uad6c\ud558\uae30<br>\ub530\ub85c \ud568\uc218\uac00 \uc5c6\uc5b4 \ub9cc\ub4e4\uc5c8\ub294\ub370. \ubb38\uc81c\ub294 \ub2ec\ub9c8\ub2e4 \ub9c8\uc9c0\ub9c9 \uc77c\uc774 \ub2e4\ub974\ub2e4\ub294\uac83<br>=&gt; MS\uc5d0\uc11c\ub3c4 \ubaa8\ud638\ud574\uc11c \ud568\uc218\ub97c \ub9cc\ub4e4\uc9c0 \uc54a\uc740 \uac83 \uac19\uc74c<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \" >static void Main(string[] args)\n{\n\tDateTime StartDate = DateTime.Parse(\"2022-01-01\");\n\tDateTime EndDate = DateTime.Parse(\"2026-03-01\");\n\n\tint DD = MonthAgeFind(StartDate, EndDate);\n\n\tConsole.WriteLine(DD);\n\tConsole.ReadLine();\n\n}\n\npublic static int MonthAgeFind(DateTime StartDate, DateTime EndDate)\n{\n\tint tempMonthCount = 0;\n\tint MonthCount = 0;\n\tbool tempFind = false;\n\n\tfor (int i = 0; i &lt;= 224; i++) \/\/\uc2dc\uc791\uc77c\uc5d0 \ud55c\ub2ec\uc529 \ub354\ud574 \uc885\ub8cc\uc77c\ubcf4\ub2e4 \ud070 \ub354\ud55c \ub2ec\ud69f\uc218\ub97c \uad6c\ud55c\ub2e4. \n\t{\n\t\tDateTime tempMonth = StartDate.AddMonths(i); \/\/\ub2ec\ub354\ud558\uae30 \n\n\t\tif (tempMonth &gt;= EndDate &amp;&amp; tempFind == false) \/\/\ud070 \ub2ec \ub354\ud55c\ud69f\uc218\uad6c\ud558\uae30\n\t\t{\n\t\t\ttempMonthCount = i;\n\t\t\ttempFind = true;\n\n\t\t\tif (tempMonthCount &gt;= 1) \/\/1\ub2ec \uc774\uc0c1\uc774\uba74 \uad50\ucc28\uc810\uc5d0\uc11c \uc2dc\uc791\uc77c\uc774 \ud06c\uba74 -1 \ud574\uc900\ub2e4.\n\t\t\t{\n\t\t\t\tDateTime tempStarDate = StartDate.AddMonths(i);\n\t\t\t\tDateTime tempEndDate = EndDate;\n\n\t\t\t\tif (tempStarDate &gt; tempEndDate)\n\t\t\t\t\ttempMonthCount = tempMonthCount - 1;\n\t\t\t}\n\n\t\t\tMonthCount = tempMonthCount;\n\n\t\t}\n\t}\n\n\treturn MonthCount;\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>\ub450 \ub0a0\uc9dc \ube44\uad50\ud574\uc11c \ub2ec\uc218 \uad6c\ud558\uae30\ub530\ub85c \ud568\uc218\uac00 \uc5c6\uc5b4 \ub9cc\ub4e4\uc5c8\ub294\ub370. \ubb38\uc81c\ub294 \ub2ec\ub9c8\ub2e4 \ub9c8\uc9c0\ub9c9 \uc77c\uc774 \ub2e4\ub974\ub2e4\ub294\uac83=&gt; MS\uc5d0\uc11c\ub3c4 \ubaa8\ud638\ud574\uc11c \ud568\uc218\ub97c \ub9cc\ub4e4\uc9c0 \uc54a\uc740 \uac83 \uac19\uc74c<\/p>\n<\/div>","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[],"class_list":["post-2199","post","type-post","status-publish","format-standard","hentry","category-devc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2199"}],"version-history":[{"count":0,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/2199\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}