{"id":7633,"date":"2023-02-21T13:32:18","date_gmt":"2023-02-21T04:32:18","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=7633"},"modified":"2023-02-24T13:40:42","modified_gmt":"2023-02-24T04:40:42","slug":"jstl-localdatetime-format","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=7633","title":{"rendered":"JSTL LocalDateTime format"},"content":{"rendered":"<h1>JSTL LocalDateTime format<\/h1>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/35606551\/jstl-localdatetime-format\">\ucc38\uc870<\/a><\/p>\n<p>LocalDateTime \uc744 \uc81c\ub300\ub85c format \ud574\uc8fc\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uac00 \uc5c6\uae30\uc5d0 \ubcc4\ub3c4\ub85c \uc0dd\uc131\ud574 \uc8fc\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>\uc544\ub798\uc5d0 \ucee4\uc2a4\ud140 \ud0dc\uadf8\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4.<\/p>\n<h2>\ud074\ub798\uc2a4 \uc0dd\uc131<\/h2>\n<pre><code class=\"language-java\">public final class Dates {\n    private Dates() {}\n\n    public static String formatLocalDateTime(LocalDateTime localDateTime, String pattern) {\n        if (localDateTime == null) {\n            return &quot;&quot;;\n        }\n        return localDateTime.format(DateTimeFormatter.ofPattern(pattern));\n    }\n}<\/code><\/pre>\n<h2>\/WEB-INF\/functions.tld<\/h2>\n<p><code>uri<\/code> \uc640 <code>function-class<\/code> \ub97c \uc801\ub2f9\ud788 \uc218\uc815\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;\n&lt;taglib\n        xmlns=&quot;http:\/\/java.sun.com\/xml\/ns\/javaee&quot;\n        xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\n        xsi:schemaLocation=&quot;http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-jsptaglibrary_2_1.xsd&quot;\n        version=&quot;2.1&quot;&gt;\n\n    &lt;tlib-version&gt;1.0&lt;\/tlib-version&gt;\n    &lt;short-name&gt;Custom_Functions&lt;\/short-name&gt;\n    &lt;uri&gt;http:\/\/kr.pe.skyer9.warehouseweb\/functions&lt;\/uri&gt;\n\n    &lt;function&gt;\n        &lt;name&gt;formatLocalDateTime&lt;\/name&gt;\n        &lt;function-class&gt;kr.pe.skyer9.warehouseweb.core.Dates&lt;\/function-class&gt;\n        &lt;function-signature&gt;java.lang.String formatLocalDateTime(java.time.LocalDateTime, java.lang.String)&lt;\/function-signature&gt;\n    &lt;\/function&gt;\n&lt;\/taglib&gt;<\/code><\/pre>\n<h2>JSP<\/h2>\n<p>JSP \uc5d0\uc11c \uc544\ub798\uc640 \uac19\uc774 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-java\">&lt;%@taglib uri=&quot;http:\/\/kr.pe.skyer9.warehouseweb\/functions&quot; prefix=&quot;f&quot; %&gt;\n\n${f:formatLocalDateTime(user.lastupdate, &#039;yyyy-MM-dd HH:mm:ss&#039;)}<\/code><\/pre>\n<h2>LocalDateTime\uc758 toString() \uba54\uc11c\ub4dc \uc0ac\uc6a9 \uc2dc 00\ucd08\uac00 \uc0ac\ub77c\uc9c0\ub294 \uacbd\uc6b0<\/h2>\n<p>\uc2dc\uac04\uc774 <code>2023-02-20 18:14:00<\/code> \uc640 \uac19\uc774 \ub05d\uc774 00 \ucd08\uac00 \ub418\ub294 \uacbd\uc6b0,<\/p>\n<p>toString() \uc5d0 \uc758\ud574 \ub098\uc624\ub294 \uac12\uc774 <code>2023-02-20 18:14<\/code> \uc640 \uac19\uc774 \ub05d\uc5d0 00 \ucd08\uac00 \uc0ac\ub77c\uc9c0\ub294 \ubb38\uc81c\uac00 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc704 \ucee4\uc2a4\ud140 \ud0dc\uadf8\ub97c \uc774\uc6a9\ud558\uba74 \uc774 \ubb38\uc81c\ub3c4 \uac19\uc774 \ud574\uacb0\ub429\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JSTL LocalDateTime format \ucc38\uc870 LocalDateTime \uc744 \uc81c\ub300\ub85c format \ud574\uc8fc\ub294 \ub77c\uc774\ube0c\ub7ec\ub9ac\uac00 \uc5c6\uae30\uc5d0 \ubcc4\ub3c4\ub85c \uc0dd\uc131\ud574 \uc8fc\uc5b4\uc57c \ud569\ub2c8\ub2e4. \uc544\ub798\uc5d0 \ucee4\uc2a4\ud140 \ud0dc\uadf8\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc744 \uc815\ub9ac\ud569\ub2c8\ub2e4. \ud074\ub798\uc2a4 \uc0dd\uc131 public final class Dates { private Dates() {} public static String formatLocalDateTime(LocalDateTime localDateTime, String pattern) { if (localDateTime == null) { return &quot;&quot;; } return localDateTime.format(DateTimeFormatter.ofPattern(pattern)); } } \/WEB-INF\/functions.tld uri \uc640 function-class\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=7633\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-7633","post","type-post","status-publish","format-standard","hentry","category-spring-boot-2-5"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7633"}],"version-history":[{"count":3,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7633\/revisions"}],"predecessor-version":[{"id":7639,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/7633\/revisions\/7639"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}