• Post Reply Bookmark Topic Watch Topic
  • New Topic

compare date in jsp  RSS feed

 
Dhirender Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am retrive two date from first JSP page to second JSP page using request.getParameter method in date1 and date2 variable.

i want to compare date1 and date2.

example:-
if (date1 > date2 )
{
out.print("date1");
}
else
{
out.print("date2");
}


Pls help
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is really a Java in General (Beginner) question but here goes...

Take a look at the GregorianCalendar Class:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/GregorianCalendar.html

It has a (int year, int month, int dayOfMonth) constructor and implements Comparable.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!