Comparing dates using JSTL

D

DaBeef

I am having problems comparing dates using JSTL. I have the follwoing
code

<jsp:useBean id="now" class="java.util.Date"/>
<c:set var="nowdate" scope="request">
<fmt:formatDate value="${now}" type="DATE" pattern="yyyy-MM-dd"/>
</c:set>
<fmt:formatDate value="${busDate}" type="DATE" pattern="yyyy-MM-dd"/>
<!-- comare dates set to false,true"-->
<c:set var="historicalDate" value ="blank"/>
<c:if test="${busDate <= nowdate}">
<c:set var="historicalDate" value ="true"/>
</c:if>

Nothing seems to be getting compared properly. What format should I
put the dates in to properly compare them.

Thank-you for your help. I haev been looking into this for quite some
time.

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top