{"id":959,"date":"2024-04-15T17:48:20","date_gmt":"2024-04-15T08:48:20","guid":{"rendered":"http:\/\/inwelly.com\/?p=959"},"modified":"2024-04-22T05:01:06","modified_gmt":"2024-04-21T20:01:06","slug":"java-%ed%98%84%ec%9e%ac%ec%9d%bc-%ed%95%98%eb%a3%a8%ec%a0%84-%ec%9d%bc%eb%85%84%ec%a0%84-%ed%95%9c%eb%8b%ac%ec%a0%84-%ec%b2%ab%eb%82%a0","status":"publish","type":"post","link":"https:\/\/inwelly.com\/?p=959","title":{"rendered":"JAVA \ud604\uc7ac\uc77c , \ud558\ub8e8\uc804 , \uc77c\ub144\uc804 , \ud55c\ub2ec\uc804 \uccab\ub0a0"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>&nbsp; &nbsp; &nbsp; SimpleDateFormat format1 = new SimpleDateFormat(&#8220;yyyyMMdd&#8221;);<\/p>\n\n\n\n<p>&nbsp; Calendar cal1 = Calendar.getInstance();<\/p>\n\n\n\n<p>&nbsp; Date cdate = cal1.getTime(); \/\/ now<\/p>\n\n\n\n<p>&nbsp; log.debug(&#8220;Current date 1 :&#8221;+cdate);<\/p>\n\n\n\n<p>&nbsp; String formatted = format1.format(cdate);<\/p>\n\n\n\n<p>&nbsp; log.debug(&#8220;Current date 2 :&#8221;+formatted+&#8221;000000&#8221;);<\/p>\n\n\n\n<p>&nbsp; Calendar cal2 = Calendar.getInstance();<\/p>\n\n\n\n<p>&nbsp; cal2.add(Calendar.DATE, -1); \/\/ previous 1 day<\/p>\n\n\n\n<p>&nbsp; Date p1day = cal2.getTime();<\/p>\n\n\n\n<p>&nbsp; String formatted_p1day = format1.format(p1day);<\/p>\n\n\n\n<p>&nbsp; log.debug(&#8220;previous 1 day :&#8221;+formatted_p1day+&#8221;000000&#8221;);<\/p>\n\n\n\n<p>&nbsp; Calendar cal3 = Calendar.getInstance();<\/p>\n\n\n\n<p>&nbsp; cal3.add(Calendar.YEAR, -1); \/\/ previous 1 year<\/p>\n\n\n\n<p>&nbsp; Date p1year = cal3.getTime();<\/p>\n\n\n\n<p>&nbsp; String formatted_p1year = format1.format(p1year);<\/p>\n\n\n\n<p>&nbsp; log.debug(&#8220;previous 1 year :&#8221;+formatted_p1year+&#8221;000000&#8221;);<\/p>\n\n\n\n<p>&nbsp; int SetMonth = -1 ; \/\/ day first of previous 1 month<\/p>\n\n\n\n<p>&nbsp; Calendar cal4 = Calendar.getInstance();<\/p>\n\n\n\n<p>&nbsp; cal4.add(Calendar.MONTH, SetMonth);<\/p>\n\n\n\n<p>&nbsp; cal4.set(Calendar.DAY_OF_MONTH, 1);<\/p>\n\n\n\n<p>&nbsp; Date pNmonth = cal4.getTime();<\/p>\n\n\n\n<p>&nbsp; String formatted_pNmonth = format1.format(pNmonth);<\/p>\n\n\n\n<p>&nbsp; log.debug(&#8220;first day of previous N Month&nbsp; :&#8221;+formatted_pNmonth+&#8221;000000&#8221;);<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; &nbsp; &nbsp; SimpleDateFormat format1 = new SimpleDateFormat(&#8220;yyyyMMdd&#8221;); &nbsp; Calendar cal1 = Calendar.getInstance(); &nbsp; Date cdate = cal1.getTime(); \/\/ now [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1280,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[],"class_list":["post-959","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=959"}],"version-history":[{"count":1,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/959\/revisions"}],"predecessor-version":[{"id":960,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/posts\/959\/revisions\/960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=\/wp\/v2\/media\/1280"}],"wp:attachment":[{"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/inwelly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}