Need method to compare two dates

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Need method to compare two dates

John Martin
I'm working on the revamped DhlService class for the Out of Origin
functionality and came across the need for a date comparison method.
I've searched throughout the code for a method that can compare two
dates to determine if date A is <, = or > than date B.  The method
must disregard the time component of the date.

Is there such a method in the framework?

I've written a simple method compareDates(java.util.Date,
java.util.Date) that I think could be added to the DateTimeUtil class
but wanted some feedback first.  The other thought is that the Jakarta
org.apache.commons.validator.routines.DateValidator.DateValidator.compareDates()
 method does the same thing.  This would mean pulling in the
commons.validator package.

Thanks,

John