my dog learned polymorphism
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with Date Object" Watch "Problem with Date Object" New topic

Problem with Date Object

sv krishnaveni

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

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Jul 26, 2007
Posts: 10747

Date class already has a compareTo method.

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link:
subject: Problem with Date Object
It's not a secret anymore!