• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

compare date in jsp

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic