need help w/o formatted date using JSTL tag

Discussions

Web tier: servlets, JSP, Web frameworks: need help w/o formatted date using JSTL tag

  1. need help w/o formatted date using JSTL tag (3 messages)

    am not getting the formatted date using fmt JSTL.My code snippet is as follows

    <c:forEach items="${results}" var="files">
    <TR>
    <TD>
    <jsp:useBean id="now" class="java.util.Date" />
    Date: <fmt:formatDate value="${now}" dateStyle="both" pattern="MM/dd/yyyy hh:mm a"/>
    <fmt:formatDate value="${files.CREATED_ON}" type="both" dateStyle="long" pattern="MM/dd/yyyy hh:mm a" />
    </TD>
    </TR>
    /c:forEach>

    and my "files.CREATED_ON" value is 2005-08-03 15:33:11.0.
    Its not formatting in given pattern.Its just simply giving the same value

    Threaded Messages (3)

  2. Are you getting any error messages?
  3. UnParseable Exception while using[ Go to top ]

    <c:forEach items="${results}" var="files">
    <TR>
    <TD>
    <jsp:useBean id="now" class="java.util.Date" />
    Date: <fmt:formatDate value="${now}" dateStyle="both" pattern="MM/dd/yyyy hh:mm a"/>
    <fmt:formatDate value="${files.CREATED_ON}" type="both" dateStyle="long" pattern="MM/dd/yyyy hh:mm a" />
    </TD>
    </TR>
    /c:forEach>
  4. DateStyle[ Go to top ]

    Try removing the dateStyle="long" attribute, it may be conflicting with the pattern attribute.