I am using JSTL. I want to display a date in JSP using <c:out ..>
tag.
I tried <c:out value = "<fmt:formatdate value = '${datevar}'"/>
.
But it displays as <fmt:formatdate value = '${datevar}'
in the HTML.
What needs to be changed to display date with expected format?
pattern
attribute. I updated the answer. See also documentation: download.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/fmt/… Note thatYYYY
is an invalid pattern for years, it should beyyyy
. See also download.oracle.com/javase/6/docs/api/java/text/… – Duffey