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

comparing 2 date objects...very urgent

 
sumit vashishta
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use methods in the java.util.Calendar class.
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this from Servlet -> Java In General (Beginner)
 
Ryan Helton
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
before/after of the date class are deprecated. There is still before/after for the Calendar class
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic