{"id":963,"date":"2018-09-17T18:52:48","date_gmt":"2018-09-17T09:52:48","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=963"},"modified":"2018-12-23T01:52:16","modified_gmt":"2018-12-22T16:52:16","slug":"calendar-getactualmaximum","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/ko\/blog\/java\/calendar-getactualmaximum","title":{"rendered":"Java \uc6d4\ub9d0 \ub0a0\uc9dc \uc5bb\uae30"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\"><strong>Java <\/strong><strong>\uc6d4\ub9d0\uc77c<\/strong>\uc5bb\uae30 <strong>Calendar.getActualMaximum()<\/strong><\/a><\/h2>\n<p>\n<strong>Java<\/strong>\uc5d0\uc11c \uc9c0\uc815\ud55c \ub0a0\uc9dc<strong>\uc6d4\ub9d0\uc77c<\/strong>\ucde8\ub4dd\ud558\ub294 \uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8\uc785\ub2c8\ub2e4.<br \/>\n<strong>java.util.Calendar<\/strong>\uc218\uc5c5<strong>getActualMaximum(Calendar.DATE)<\/strong>\uc5d0\uc11c<strong>\uc6d4\ub9d0\uc77c<\/strong>\uc744 \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2 class=\"common_title\"><a name=\"1\">\uc0d8\ud50c \ud504\ub85c\uadf8\ub7a8<\/a><\/h2>\n<pre class=\"sample_src\">\/** * \uc9c0\uc815\ub41c \ub0a0\uc9dc \ubb38\uc790\uc5f4(yyyy\/MM\/dd or yyyy-MM-dd) * \uc758 \uc6d4\ub9d0 \ub0a0\uc9dc\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. * * @param strDate \ub300\uc0c1\uc758 \ub0a0\uc9dc \uce90\ub9ad\ud130 \ub77c\uc778 * @return \uc6d4\ub9d0 \uc77c\uc790 *\/ public static int getLastDay(String strDate) { if (strDate == null || strDate.length() != 10) { throw new IllegalArgumentException( &quot;\uc778\uc218 \uc758 \ubb38\uc790\uc5f4[&quot;+ strDate +&quot;]&quot; + &quot;\uc740 \uc798\ubabb\ub418\uc5c8\uc2b5\ub2c8\ub2e4.&quot;); } int yyyy = Integer.parseInt(strDate.substring(0,4)); int MM = Integer.parseInt(strDate.substring(5) ,7)); int dd = Integer.parseInt(strDate.substring(8,10)); Calendar cal = Calendar.getInstance(); cal.set(yyyy,MM-1,dd); int last = cal.getActualMaximum (Calendar.DATE); return last; }\r\n<\/pre>\n<p><script type=\"text\/javascript\" src=\"https:\/\/chat-messenger.com\/js\/common.js?dd12sssas2223\" charset=\"UTF-8\"><\/script><br \/>\n<script type=\"text\/javascript\"> writePR(); <\/script><\/p>\n<h2 class=\"common_title\"><a name=\"2\">\uc2e4\ud589 \uacb0\uacfc<\/a><\/h2>\n<p>\u25c6\uc2e4\ud589\uc608<\/p>\n<pre class=\"sample_src\">public static void main(String[] args) { System.out.println(getLastDay(&quot;2007\/01\/01&quot;)); System.out.println(getLastDay(&quot;2007\/02\/01&quot;)); System.out .println(getLastDay(&quot;2008\/02\/01&quot;)); }\r\n<\/pre>\n<p>\u25c6\ucd9c\ub825 \uacb0\uacfc<\/p>\n<pre class=\"console\">31\r\n28\r\n29\r\n<\/pre>\n<p>\u203b2008\ub144\uc740 \uc724\ub144 \ub54c\ubb38\uc5d0 2\uc6d4\uc758 \uc6d4\ub9d0 \uc77c\uc790\ub294 29\uc77c\uc774 \ub429\ub2c8\ub2e4.<\/p>","protected":false},"excerpt":{"rendered":"<p>Java \uc6d4\ub9d0 \uc77c\uc790\ub97c \ucde8\ub4dd\ud55c\ub2e4 Calendar.getActualMaximum() Java\ub85c \uc9c0\uc815\ud55c \uc77c\uc790\uc758 [\u2026]<\/p>","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[19],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/963"}],"collection":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/comments?post=963"}],"version-history":[{"count":4,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/963\/revisions"}],"predecessor-version":[{"id":1874,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/posts\/963\/revisions\/1874"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/media?parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/categories?post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/ko\/wp-json\/wp\/v2\/tags?post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}