File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Dates" Watch "Dates" New topic
Author

Dates

vin Hari
Ranch Hand

Joined: Nov 16, 2006
Posts: 161
Hi all,
please tell me how to compare dates like
12/12/2006 assume as todays date and 10/12/2006 as another date
hoow to compare these dates.
Joice Jose
Greenhorn

Joined: Jun 29, 2005
Posts: 14
Use java.util.Date class to compare dates. This class provides methods such as compareTo(), after(), before(), etc.
Chengwei Lee
Ranch Hand

Joined: Apr 02, 2004
Posts: 884
Look into the Java API. Take a look at the following classes: Calendar, GregorianCalendar & Date. You need to know that when doing date comparison, its not really just the day component, there's also the time component, if it is to be disregarded, you have to set the time component to be the same.


SCJP 1.4 * SCWCD 1.4 * SCBCD 1.3 * SCJA 1.0 * TOGAF 8
 
GeeCON Prague 2014
 
subject: Dates