{"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\/th\/\u0e1a\u0e25\u0e47\u0e2d\u0e01\/java\/\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a\u0e04\u0e48\u0e32\u0e2a\u0e39\u0e07\u0e2a\u0e38\u0e14\u0e15","title":{"rendered":"\u0e23\u0e31\u0e1a\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e2a\u0e34\u0e49\u0e19\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e43\u0e19\u0e20\u0e32\u0e29\u0e32 Java"},"content":{"rendered":"<h2 class=\"common_title\"><a name=\"0\"><strong>\u0e0a\u0e27\u0e32 <\/strong><strong>\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e2a\u0e34\u0e49\u0e19\u0e40\u0e14\u0e37\u0e2d\u0e19<\/strong>\u0e23\u0e31\u0e1a <strong>Calendar.getActualMaximum()<\/strong><\/a><\/h2>\n<p>\n<strong>\u0e0a\u0e27\u0e32<\/strong>\u0e02\u0e2d\u0e07\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38\u0e44\u0e27\u0e49\u0e43\u0e19<strong>\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e2a\u0e34\u0e49\u0e19\u0e40\u0e14\u0e37\u0e2d\u0e19<\/strong>\u0e19\u0e35\u0e48\u0e04\u0e37\u0e2d\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e17\u0e35\u0e48\u0e08\u0e30\u0e44\u0e14\u0e49\u0e23\u0e31\u0e1a .<br \/>\n<strong>java.util.\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19<\/strong>\u0e23\u0e30\u0e14\u0e31\u0e1a<strong>getActualMaximum (\u0e1b\u0e0f\u0e34\u0e17\u0e34\u0e19\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48)<\/strong>\u0e43\u0e19<strong>\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e2a\u0e34\u0e49\u0e19\u0e40\u0e14\u0e37\u0e2d\u0e19<\/strong>\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e23\u0e31\u0e1a\u0e44\u0e14\u0e49.\n<\/p>\n<h2 class=\"common_title\"><a name=\"1\">\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07<\/a><\/h2>\n<pre class=\"sample_src\">\/** * \u0e2a\u0e48\u0e07\u0e01\u0e25\u0e31\u0e1a\u0e27\u0e31\u0e19\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e02\u0e2d\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e43\u0e19\u0e2a\u0e15\u0e23\u0e34\u0e07\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38 (yyyy\/MM\/dd \u0e2b\u0e23\u0e37\u0e2d yyyy-MM-dd) * * * @param strDate \u0e2a\u0e15\u0e23\u0e34\u0e07\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22 * @return \u0e27\u0e31\u0e19\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e02\u0e2d\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19 *\/ public static int getLastDay(String strDate) { if (strDate == null || strDate.length() != 10) { \u0e42\u0e22\u0e19\u0e43\u0e2b\u0e21\u0e48 IllegalArgumentException( &quot; \u0e2d\u0e32\u0e23\u0e4c\u0e01\u0e34\u0e27\u0e40\u0e21\u0e19\u0e15\u0e4c \u0e2a\u0e15\u0e23\u0e34\u0e07 [&quot;+ strDate +&quot;]&quot; + &quot;is invalid.&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 \u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22 = cal.getActualMaximum ( Calendar.DATE); \u0e01\u0e25\u0e31\u0e1a\u0e04\u0e23\u0e31\u0e49\u0e07\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22; }\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\">\u0e1c\u0e25\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/a><\/h2>\n<p>\u25c6\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e01\u0e32\u0e23<\/p>\n<pre class=\"sample_src\">\u0e42\u0e21\u0e06\u0e30\u0e04\u0e07\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e18\u0e32\u0e23\u0e13\u0e30 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\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e40\u0e2d\u0e32\u0e17\u0e4c\u0e1e\u0e38\u0e15<\/p>\n<pre class=\"console\">31\r\n28\r\n29\r\n<\/pre>\n<p>*2008 \u0e40\u0e1b\u0e47\u0e19\u0e1b\u0e35\u0e2d\u0e18\u0e34\u0e01\u0e2a\u0e38\u0e23\u0e17\u0e34\u0e19 \u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e27\u0e31\u0e19\u0e2a\u0e38\u0e14\u0e17\u0e49\u0e32\u0e22\u0e02\u0e2d\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48 29<\/p>","protected":false},"excerpt":{"rendered":"<p>Java \u0e23\u0e31\u0e1a\u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e2a\u0e34\u0e49\u0e19\u0e2a\u0e38\u0e14\u0e02\u0e2d\u0e07\u0e40\u0e14\u0e37\u0e2d\u0e19 Calendar.getActualMaximum() \u0e27\u0e31\u0e19\u0e17\u0e35\u0e48\u0e17\u0e35\u0e48\u0e23\u0e30\u0e1a\u0e38\u0e43\u0e19 Java [\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\/th\/wp-json\/wp\/v2\/posts\/963"}],"collection":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/comments?post=963"}],"version-history":[{"count":4,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts\/963\/revisions"}],"predecessor-version":[{"id":1874,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/posts\/963\/revisions\/1874"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/media?parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/categories?post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/th\/wp-json\/wp\/v2\/tags?post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}