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

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top