• Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl - compare date ignoring the day

 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
on a jsp page I've got two dates to compare. The problem is that I must avoid the day and see if they equals only on the month and year.
Any suggestions?

Thanks in advance.
[ February 15, 2007: Message edited by: Alessandro Ilardo ]
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use substring of Class String to extract the year and month from this then compare this values..

you would find an example of substring on above link..

hope it helps..
 
Alessandro Ilardo
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm making some sintax error, but I can't fingure it out.
Would you have a look on the code above and give me your suggestion?

Thanks
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is selectPeriod is String variable?

1. String "s" should be small in substring.
2. substring is only works with String type variable.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!