This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 11021
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