Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSTL - Comparing dates

843838May 11 2006 — edited Jun 6 2006
I 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 4 2006
Added on May 11 2006
1 comment
920 views