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 &lt;parsedate&gt;, 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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -