• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL date comparison  RSS feed

 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey All,

I have this requirement where i have group of records and each record has a date associated with it. I need to compare the date field with another standard date and depending on the outcome, i need to display some content.

I am trying to use the following code

<c:if test="${todaysdate ge recordDate}">Standard Content</c:if>

For some reason it is not working, any clues ??

I appreciate responses.
[ November 22, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refrain from using all upper-case when posting. I have changed the topic title for you.

As per forum instructions, please include the versions of JSP and JSTL that you are using.
 
Vicky Mohan
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSTL - 1.1

JSP - 2.0
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So how do you get the values of "todaysdate" and "recordDate"
Are they Date objects or Strings?

>For some reason it is not working,
Can you be more specific about what is not working?

Does it throw an error?
Does it give a result you don't expect?
Is it slacking off surfing the internet when it should be working?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!