This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "comparing 2 date objects...very urgent" Watch "comparing 2 date objects...very urgent" New topic
Author

comparing 2 date objects...very urgent

sumit vashishta
Greenhorn

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.


Bosun (SCJP, SCWCD)
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
Greenhorn

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
Thanks!
Ryan


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: http://aspose.com/file-tools
 
subject: comparing 2 date objects...very urgent