Is there a way to have only dates compared for DateTime object with isBefore function?
For ex.,
DateTime start = new DateTime(Long.parseLong(<someInput>));
DateTime end = new DateTime(Long.parseLong(<someInput>));
Now when I do,
while (start.isBefore(end)) {
// add start date to the list
start = start.plusDays(1);
}
This results in inconsistent behavior (for my scenario) as it is taking into consideration time as well whereas what I want is to have just the dates compared using isBefore. Is there a way I can do that?
Please let me know.
Thanks!
If you want to compare dates only you probably want to use the
LocalDateclass, rather than aDateTime.The JodaTime docs are pretty good: http://joda-time.sourceforge.net/apidocs/org/joda/time/LocalDate.html