Sorry, I tried referred the methods from Similar Method. But i still cannot get solution. How can i get the output months and days between two difference dates? Any helps would be appreciated.Thanks.
P/s : JodaTime not applicable.
What i've tried so far.
SimpleDateFormat formatter= new SimpleDateFormat("dd-MM-yyyy");
String start = "03-01-2015";
String end = "01-11-2014";
Date startdate = formatter.parse(start);
Date enddate = formatter.parse(end);
Calendar startCalendar = new GregorianCalendar();
startCalendar.setTime(startdate);
Calendar endCalendar = new GregorianCalendar();
endCalendar.setTime(enddate);
int diffYear = endCalendar.get(Calendar.YEAR) - startCalendar.get(Calendar.YEAR);
int diffMonth = diffYear * 12 + endCalendar.get(Calendar.MONTH) -startCalendar.get(Calendar.MONTH);