I want to find out from the startDate and endDate how many days is it. From my json response, I can get back these in String:
String startDate = "Fri, 10 Jan 2015 23:10:04 +0000";
String endDate = "Mon, 26 Jan 2015 11:26:04 +0000";
How would I use joda to calculate and get me back the correct number of days (hence: numOfDays = endDate - startDate) ??
public int getNumberOfDays(String startDate, String endDate) {
String pattern = "EEE, dd MMM yyyy HH:mm:ss +xxxx";
.....
// quick test on startDate
DateTime dateTime = DateTime.parse(startDate, DateTimeFormat.forPattern(pattern));
System.out.println("The day should be 10 but it yields 9 --> " + dateTime.getDayOfMonth());
}