Exemple #1
0
 public static long getMonthDiffOnlyOfTwoDate(Date startDate, Date endDate) {
   String start = TimeTool.toStrDateFromUtilDateByFormat(startDate, "yyyy-MM-dd");
   String end = TimeTool.toStrDateFromUtilDateByFormat(endDate, "yyyy-MM-dd");
   if (start.equals(end)) { // 只比较到月
     return 0;
   }
   return getDaysOfTowDiffDate(startDate, endDate) / 30;
 }