aspose file tools*
The moose likes Servlets and the fly likes Problem with Date Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with Date Object" Watch "Problem with Date Object" New topic
Author

Problem with Date Object

sv krishnaveni
Greenhorn

Joined: Mar 15, 2008
Posts: 3
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

Joined: Mar 06, 2001
Posts: 13459

java.text.SimpleDateFormat is you (non thread safe) friend.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10360
    
    8

Date class already has a compareTo method.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
Don't get me started about those stupid light bulbs.
 
subject: Problem with Date Object