jsp - JSTL fmt:parsedate of pubDate attribute in RSS 2.0 -
i need parse string in order convert date:
tue, 3 sep 2013 19:47:52 +0200
i'm using
<fmt:parsedate var="parseddate" value="${pubdate}" type="both"/>
but result is:
org.apache.jasper.jasperexception: javax.servlet.servletexception: javax.servlet.jsp.jspexception: in <parsedate>, value attribute can not parsed: "tue, 3 sep 2013 19:04:18 +0200"
what's wrong this?
<fmt:parsedate>
going attempt parse date based on locale. can see via <fmt:formatdate>
:
<jsp:usebean id="now" class="java.util.date"/> <fmt:formatdate value="${now}" type="both"/>
i'd recommend using explicit pattern:
<fmt:parsedate var="parseddate" value="${pubdate}" pattern="eee, dd mmm yyyy hh:mm:ss z"/>
(the patterns letters simpledateformat)
Comments
Post a Comment