Meaningless Drivel is fun!
The moose likes Beginning Java and the fly likes comparing 2 date objects...very urgent Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "comparing 2 date objects...very urgent" Watch "comparing 2 date objects...very urgent" New topic

comparing 2 date objects...very urgent

sumit vashishta

Joined: Jun 14, 2001
Posts: 15
hi all,
how to compare 2 date objects....
when i use methods of Date class...i get a warning when using before(), after()
saying that they are deprecated...that is correct.
in what other way can i compare...
pl. give code as a hint..
thankx in advance
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Use methods in the java.util.Calendar class.

So much trouble in the world -- Bob Marley
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Moving this from Servlet -> Java In General (Beginner)
Ryan Helton

Joined: Oct 25, 2001
Posts: 11
After reading the 1.4 API docs it seems to me that before() and after() are still the best methods for comparing date objects. Why then would they be deprecated?
I still have a limited understanding of deprecated methods so I'm sure I'm just missing something here

Ryan<p>---------------------------------<br />"We will stomp to the top with the wind in our teeth."
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
before/after of the date class are deprecated. There is still before/after for the Calendar class
I agree. Here's the link:
subject: comparing 2 date objects...very urgent
It's not a secret anymore!