How to write a function which returns number of days between two dates in Gregorian Callendar? What type should I convert my dates and how?
public int substractDate(GregorianCalendar beginningDate, GregorianCalendar endingDate){
return dif;
}
Use GregorianCalendar object which is a subclass of Calendar:
String dayPattern = "DD";
SimpleDateFormat days = new SimpleDateFormat(dayPattern);
return Integer.parseInt(days.format(endingDate.getTimeInMillis()-beginningDate.getTimeInMillis()));