{"id":5034,"date":"2018-01-04T10:10:16","date_gmt":"2018-01-04T01:10:16","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=5034"},"modified":"2020-05-28T14:11:03","modified_gmt":"2020-05-28T05:11:03","slug":"java-%ec%98%a4%eb%8a%98-%eb%82%a0%ec%a7%9c-%ec%96%b4%ec%a0%9c-%eb%82%a0%ec%a7%9c","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=5034","title":{"rendered":"[Java] \uc624\ub298 \ub0a0\uc9dc, \uc5b4\uc81c \ub0a0\uc9dc"},"content":{"rendered":"<p>Java\uc5d0\uc11c \uc624\ub298 \ub0a0\uc9dc\ub97c \uad6c\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \uc9d1\uacc4 \uc11c\ube44\uc2a4\ub97c \ub9cc\ub4e4\uae30 \uc704\ud574 \uc0ac\uc6a9\ud55c \ucf54\ub4dc\uc778\ub370\uc694.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\nGregorianCalendar today = new GregorianCalendar();\r\n\r\nint Year = today.get(Calendar.YEAR);\r\nint Month = today.get(Calendar.MONTH);\r\nint Date = today.get(Calendar.DATE);\r\nint Hour = today.get(Calendar.HOUR_OF_DAY);\r\n<\/pre>\n<p>GregorianCalendar \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud560 \ub54c \ud30c\ub77c\uba54\ud130\ub97c \uc8fc\uc9c0 \uc54a\uc73c\uba74 \uc624\ub298 \ub0a0\uc9dc\uc5d0 \ub300\ud55c \uac1d\uccb4\uac00 \uc0dd\uc131\ub429\ub2c8\ub2e4. \uc8fc\uc758\ud560 \uc810\uc740 GregorianCalendar\uc758 1\uc6d4\uc744 0\ubd80\ud130 \uc2dc\uc791\ud558\ubbc0\ub85c, \ud544\uc694\uc2dc\uc5d0 \uc6d4\uc758 \uac12\uc5d0 1\uc744 \ub354\ud574\uc918\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>\ucc38\uace0\ub85c get \ub9e4\uc11c\ub4dc\uc5d0\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294, \uac01 \uc2dc\uac04\uc758 \ub2e8\uc704\ub97c \uc5bb\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uac12\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n<ul>\n<li>Calendar.YEAR &#8211; \ub144\ub3c4<\/li>\n<li>Calendar.MONTH &#8211; \uc6d4(0~11)<\/li>\n<li>Calendar.DATE &#8211; \uc77c<\/li>\n<li>Calendar.AP_PM &#8211; \uc624\uc804\/\uc624\ud6c4<\/li>\n<li>Calendar.HOUR &#8211; \uc2dc<\/li>\n<li>Calendar.MINUTE &#8211; \ubd84<\/li>\n<li>Calendar.SECODE &#8211; \ucd08<\/li>\n<\/ul>\n<p>\uc774\uc81c \uc5ec\uae30\uc11c \ud55c\ub2e8\uacc4 \ub354 \ub098\uc544\uac00.. \uc5b4\uc81c\ub294? \ud55c\ub2ec\uc804\uc740? \uc77c\uc8fc\uc77c\uc804\uc740? \uc5b4\ub5bb\uac8c \uc54c \uc218 \uc788\uc744\uae4c.. \uc544\ub798\uc758 \ucf54\ub4dc\ub294 \uc704\uc758 today\ub97c \uae30\uc900\uc73c\ub85c 1\uc77c \uc804\uc744 \ub098\ud0c0\ub0b4\ub294 \ucf54\ub4dc\uc785\ub2c8\ub2e4.<\/p>\n<pre>today.add(Calendar.DAY_OF_MONTH, -1);<\/pre>\n<p>\uc704\uc758 \ucf54\ub4dc\ub97c \uc774\uc6a9\ud558\uba74 \ud2b9\uc815 \ub0a0\uc9dc\ub97c \uae30\uc900\uc73c\ub85c \uc6d0\ud558\ub294 \ub0a0\uc9dc\ub97c \uc815\ud655\ud558\uac8c \ud30c\uc545\ud560 \uc218 \uc788\uc744 \uac83\uc785\ub2c8\ub2e4. GregorianCalendar \uc5d0\uc11c \uae30\ubcf8\uc801\uc73c\ub85c \uc0ac\uc6a9\ud558\ub294 TimeZone\uc740 OS\uc5d0\uc11c \uc124\uc815\ub41c \ub098\ub77c\ub85c \uc9c0\uc815\ub429\ub2c8\ub2e4. \uc774 TimeZone\uc740 setTimeZone \ub9e4\uc11c\ub4dc\ub97c \ud1b5\ud574 \uc7ac\ubcc0\uacbd\uc774 \uac00\ub2a5\ud569\ub2c8\ub2e4. \uc544\ub798\uc758 \ucf54\ub4dc\ub294  Europe\/London\uc5d0 \ub300\ud55c TimeZone\uc73c\ub85c \ubcc0\uacbd\ud558\ub294 \ucf54\ub4dc \uc608\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\nTimeZone timeZone = TimeZone.getTimeZone(\"Europe\/London\");\r\ntoday.setTimeZone(timeZone);\r\n<\/pre>\n<p>\ub05d\uc73c\ub85c GregorianCalendar \uac1d\uccb4\uc758 \uc2dc\uac04\uc744 \ub2e4\uc591\ud558\uac8c \ud45c\ud604\ud558\uae30 \uc704\ud574 SimpleDateFormat \ud074\ub798\uc2a4\ub97c \uc0ac\uc6a9\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798\uc758 \ucf54\ub4dc\ub294 SimpleDateFormat \ud074\ub798\uc2a4\ub974 \uc0ac\uc6a9\ud574 \uc6d0\ud558\ub294 \ud615\uc2dd\uc73c\ub85c \uc2dc\uac04\uc744 \ud45c\ud604\ud558\ub294 \ucf54\ub4dc \uc608\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\">\r\nGregorianCalendar today = new GregorianCalendar();\r\nSimpleDateFormat format = new SimpleDateFormat(\"yyyy\ub144 MM\uc6d4 dd\uc77c aa hh\uc2dc mm\ubd84 ss\ucd08\");\r\nString strTime = format.format(today.getTime());\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Java\uc5d0\uc11c \uc624\ub298 \ub0a0\uc9dc\ub97c \uad6c\ud558\uae30 \uc704\ud55c \ucf54\ub4dc\uc785\ub2c8\ub2e4. \uc9d1\uacc4 \uc11c\ube44\uc2a4\ub97c \ub9cc\ub4e4\uae30 \uc704\ud574 \uc0ac\uc6a9\ud55c \ucf54\ub4dc\uc778\ub370\uc694. GregorianCalendar today = new GregorianCalendar(); int Year = today.get(Calendar.YEAR); int Month = today.get(Calendar.MONTH); int Date = today.get(Calendar.DATE); int Hour = today.get(Calendar.HOUR_OF_DAY); GregorianCalendar \ud074\ub798\uc2a4\ub97c \uc0dd\uc131\ud560 \ub54c \ud30c\ub77c\uba54\ud130\ub97c \uc8fc\uc9c0 \uc54a\uc73c\uba74 \uc624\ub298 \ub0a0\uc9dc\uc5d0 \ub300\ud55c \uac1d\uccb4\uac00 \uc0dd\uc131\ub429\ub2c8\ub2e4. \uc8fc\uc758\ud560 \uc810\uc740 GregorianCalendar\uc758 1\uc6d4\uc744 0\ubd80\ud130 \uc2dc\uc791\ud558\ubbc0\ub85c, \ud544\uc694\uc2dc\uc5d0 \uc6d4\uc758 \uac12\uc5d0 1\uc744 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=5034\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;[Java] \uc624\ub298 \ub0a0\uc9dc, \uc5b4\uc81c \ub0a0\uc9dc&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[],"class_list":["post-5034","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/5034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5034"}],"version-history":[{"count":6,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/5034\/revisions"}],"predecessor-version":[{"id":9636,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/5034\/revisions\/9636"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5034"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}