return null;
}
try {
if (param1 instanceof java.util.Date && param2 instanceof java.util.Date) {
if (param1 instanceof Time || param2 instanceof Time) {
throw new ParseException();
}
java.util.Date d1 = (java.util.Date)param1;
java.util.Date d2 = (java.util.Date)param2;
cal.setTimeInMillis(d1.getTime());
int y1 = cal.get(YEAR);
int m1 = cal.get(MONTH);
int dt1 = cal.get(DATE);
cal.setTimeInMillis(d2.getTime());
int y2 = cal.get(YEAR);
int m2 = cal.get(MONTH);
int dt2 = cal.get(DATE);
BigDecimal m = new BigDecimal((y1-y2)*12+(m1-m2));
BigDecimal d = new BigDecimal(dt1-dt2);
d = d.divide(DAYS_IN_MONTH, 40, BigDecimal.ROUND_HALF_UP);
return m.add(d);
} else {
throw new ParseException();
}
} catch (ParseException e) {
throw new ParseException(WRONG_TYPE+" month_between("+param1.getClass()+","+param2.getClass()+")");
}
}