Hi, I ask myself if there is an easier way to get the number of days between two dates.
I want only days without looking at hours or minutes.
Therefore, if today is Monday, and the date I want to compare is on Wednesday, the days between them are 2 (time does not matter)
Therefore, I use this code:
Calendar c = Calendar.getInstance();
after this code, I have days in the long name dayDiff. but do you really need to make a calendar with a date, set the time to 00: 00: 00: 00 and save to.getTime() in date ?
Edit: after using joda-time : Is it also possible to use joda-time to get information about the days, for example: difference == 1 ==> Tomorrow, or difference == -1 ==> yesterday or do I need to do this manually?
source share