aspose 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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dates
 
Similar Threads
compare two dates thru Calendar
Struts ValidWhen validation
Date comparision
Regular expression to compare numbers
converting to date format