Back
I would like to have a compareTo method that ignores the time portion of a java.util.Date. I guess there are a number of ways to solve this. What's the simplest way?
Apache commons-lang is almost ubiquitous.
(DateUtils.isSameDay(date1, date2)) { // it's same} else if (date1.before(date2)) { // it's before} else { // it's after}hat about this?
(DateUtils.isSameDay(date1, date2)) {
// it's same
} else if (date1.before(date2)) {
// it's before
} else {
// it's after
}hat about this?
31k questions
32.8k answers
501 comments
693 users