JSTL - Comparing dates
843838May 11 2006 — edited Jun 6 2006I want to compare two dates, one I get using JSTL to get the current date, and the other i get from my postgresql database.
The variable forexdate is my variable that holds my date from the db, and startSendDate is my current date.
the dates are the same but my if cont seem to work:
<jsp:useBean id="now" class="java.util.Date"/>
<c:set var="startSendDate" scope="session"><fmt:formatDate value="${now}" type="DATE" pattern="yyyy-MM-dd"/></c:set>
<c:if test="${forexdate != startSendDate}">
<c:set var="error" value="error" scope="session"/>
<c:set var="reason" value="Latest Forex Rate doesn't match"/>
</c:if>
${error}....${startSendDate}......${forexDate}
and it display this, and the dates are the same:
error....2006-05-11......2006-05-11
what is wrong with my if?