{"id":149,"date":"2012-09-03T15:24:38","date_gmt":"2012-09-03T06:24:38","guid":{"rendered":"http:\/\/www.freesens.com\/x\/?p=149"},"modified":"2012-09-05T13:15:17","modified_gmt":"2012-09-05T04:15:17","slug":"java-text-parseexception-unparseable-date","status":"publish","type":"post","link":"http:\/\/www.freesens.com\/x\/?p=149","title":{"rendered":"java.text.ParseException: Unparseable date:"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>String\ud615\ud0dc\uc758 \ubb38\uc790\uc5f4 \ub0a0\uc9dc\ud615\uc2dd\uc5d0 \ub300\ud574\uc11c date format\uc73c\ub85c \ubcc0\ud658\uc2dc \ud30c\uc2f1\uc624\ub958\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\ub294\ub370, \uc774\ub294 \uc800\uc7a5\ub41c \ubb38\uc790\uc5f4 \ub0a0\uc9dc\ud615\uc2dd\uacfc \ud604\uc7ac \ub0b4 \uc2dc\uc2a4\ud15c\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \ubb38\uc790\uc5f4\uc758 \ub0a0\uc9dc\ud615\uc2dd locale\ub2ec\ub77c\uc11c \ubc1c\uc0dd\ud558\ub294\uac83\uc73c\ub85c \ucd94\uc815\ud568&#8230;(\uadf8\ub0e5 \ubb34\ucc45\uc784\ud558\uac8c&#8230;..)&#8230;.<\/p>\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"5\" bgcolor=\"#f7f7f7\">\n<tbody>\n<tr>\n<td>\n<pre>public static void main(String[] args) {\r\n\tString param = \"<span style=\"color: #0000ff;\"><strong>11\/Jun\/2012:00:00:00<\/strong><\/span>\";\r\n\r\n\tDateFormat parser = new SimpleDateFormat(\"dd\/MMM\/yyyy:HH:mm:ss\", <strong><span style=\"color: #ff0000;\">Locale.ENGLISH<\/span><\/strong>);\r\n\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\r\n\tif (param == null || param.equals(\"\")) {\r\n\t\tSystem.out.println(\"Null or Empty\");\r\n\t}\r\n\tif (param.length() == 8) {\r\n\t\tparam += \"000000\";\r\n\t}\r\n\tDate date;\r\n\ttry {\r\n\t\tdate = parser.parse(param);\r\n\t\tSystem.out.println(formatter.format(date).toString());\r\n\t} catch (ParseException e) {\r\n\t\tSystem.out.println(\"exception = \" + e.getMessage());\r\n\t}\r\n}<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\uc704\uc758 \uc0d8\ud50c\uacfc \uac19\uc774 \ubcc0\ud658\ub300\uc0c1 \ub0a0\uc9dc \ud615\uc2dd\uc5d0 &#8220;Jun&#8221; \uc73c\ub85c 6\uc6d4\uc774 \uc601\ubb38\uc73c\ub85c \ud45c\uc2dc\ub418\uace0 \uc788\ub294\ub370, \ub0b4 PC\uc5d0\uc11c\ub294 locale\uc774 \ud55c\uad6d\uc5b4\ub85c \uc124\uc815\ub418\uc5b4 \uc788\uae30 \ub54c\ubb38\uc5d0, \uc704\uc758 \ucf54\ub4dc\uc0c1\uc5d0\uc11c Locale.ENGLISH\uac00 \ube60\uc838\uc788\ub294 \uacbd\uc6b0\uc5d0\ub294 ParseException\uc774 \ubc1c\uc0dd\ud558\uae30 \ub54c\ubb38\uc5d0, \uc6d0\ubcf8 \ub0a0\uc9dc\ud615\uc2dd \ubb38\uc790\uc5f4\uc758 Locale\uc744 \uc9c0\uc815\ud574\uc918\uc57c \uc815\uc0c1\uc801\uc73c\ub85c \ud30c\uc2f1\uc774 \uac00\ub2a5\ud568.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; String\ud615\ud0dc\uc758 \ubb38\uc790\uc5f4 \ub0a0\uc9dc\ud615\uc2dd\uc5d0 \ub300\ud574\uc11c date format\uc73c\ub85c \ubcc0\ud658\uc2dc \ud30c\uc2f1\uc624\ub958\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\ub294\ub370, \uc774\ub294 \uc800\uc7a5\ub41c \ubb38\uc790\uc5f4 \ub0a0\uc9dc\ud615\uc2dd\uacfc \ud604\uc7ac \ub0b4 \uc2dc\uc2a4\ud15c\uc5d0\uc11c \uc0ac\uc6a9\ud558\ub294 \ubb38\uc790\uc5f4\uc758 \ub0a0\uc9dc\ud615\uc2dd locale\ub2ec\ub77c\uc11c \ubc1c\uc0dd\ud558\ub294\uac83\uc73c\ub85c \ucd94\uc815\ud568&#8230;(\uadf8\ub0e5 \ubb34\ucc45\uc784\ud558\uac8c&#8230;..)&#8230;. public static void main(String[] args) { String param = &#8220;11\/Jun\/2012:00:00:00&#8221;; DateFormat parser = new SimpleDateFormat(&#8220;dd\/MMM\/yyyy:HH:mm:ss&#8221;, Locale.ENGLISH); DateFormat formatter = new SimpleDateFormat(&#8220;yyyy-MM-dd HH:mm:ss&#8221;); if (param == null || param.equals(&#8220;&#8221;)) { &hellip; <a href=\"http:\/\/www.freesens.com\/x\/?p=149\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">java.text.ParseException: Unparseable date:<\/span> <span class=\"meta-nav\">&rarr;<\/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":[13],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-java"],"_links":{"self":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":2,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":233,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions\/233"}],"wp:attachment":[{"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.freesens.com\/x\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}