Hi Everyone!
I am trying to parse a date in a page, however What I need is the date in "yyyy-MM-dd" and "dd/MM/yyyy" formats. Now
<c:choose>
<c:when test="${param.from != null}">
<fmt:parseDate value="${param.from}" var="from" pattern="dd/MM/yyyy" type="date"></fmt:parseDate>
</c:when>
<c:otherwise>
<jsp:useBean id="from" class="java.util.Date" />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${param.to != null}">
<fmt:parseDate value="${param.to}" var="to" pattern="dd/MM/yyyy" type="date"></fmt:parseDate>
</c:when>
<c:otherwise>
<jsp:useBean id="to" class="java.util.Date" />
</c:otherwise>
</c:choose>
Solves my problem for the "dd/MM/yyyy" pattern but when I try to use the "yyyy-MM-dd" with parseDate I get exceptions saying e.g "05/09/2005" cannot be parsed I need the "yyyy-MM-dd" pattern for MySQL query.
Any idea/ help will be greatly apperciated.
Thanks