code: public static int getNumOfMonths(Date date1, Date date2) {
  		Calendar firstDate = Calendar.getInstance();
  		Date date = new Date(date1.getTime());
  		firstDate.setTime(date);
  		Calendar secondDate = Calendar.getInstance();
  		Date date3 = new Date(date2.getTime());
  		secondDate.setTime(date3);
  		int months = firstDate.get(Calendar.MONTH) - secondDate.get(Calendar.MONTH);
  
  		return months;
  	}
docs: Gets the num of months.
  
  @param date1 the date 1
  @param date2 the date 2
  @return the num of months