Before this question is marked as a duplicate, it's not. I know this question, and I tried to use it's answer, to no avail so far.
I've got a date on which some event occurred, and I've got DateTime.now(). I now want to display the words "today" or "yesterday" if the date is today or yesterdays dates. If not (it's further in the past) the date should simply be printed. For this I want to know the difference in days between DateTime.now() and the DateTime at which the event occurred. So I tried this:
DateTime actionDate = overviewevent.getActionDate();
Log.wtf(TAG, actionDate.toString()); // Prints 2013-09-06T08:47:04.000+01:00
LocalDate localActionDate = actionDate.toLocalDate();
LocalDate localNow = DateTime.now().toLocalDate();
// First try
Log.wtf(TAG, Integer.toString(localActionDate.compareTo(localNow)));
// Second try
Log.wtf(TAG, Integer.toString(DateTimeComparator.getDateOnlyInstance().compare(actionDate, DateTime.now())));
Even though there are 10 days between now() and the actionDate, both of the things I try just print "1".
Does anybody know how I can see how many days the dates are apart?