Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Date Object

 
sv krishnaveni
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to compare two dates (date format is dd:mm:yyyy hh:mm )in two different servlets...
for that i am converting date into string..and passing that string as parameter to another servlet...
for me it was giving null value...
for this how do we convert that string into dd:mm:yyyy hh:mm and how to compare two date objetcs....
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.text.SimpleDateFormat is you (non thread safe) friend.
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Date class already has a compareTo method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic