Your Name
2023-03-11 f1eb8b84e943ea9c3e56572855c5f63bbe9273d8
java110-utils/src/main/java/com/java110/utils/util/DateUtil.java
@@ -477,6 +477,15 @@
    }
    public static String getAddHoursStringA(Date date, int hours) {
        SimpleDateFormat sf = new SimpleDateFormat(DATE_FORMATE_STRING_A);
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        c.add(Calendar.HOUR_OF_DAY, hours);
        return sf.format(c.getTime());
    }
    public static String getAddMonthStringA(Date date, int month) {
        SimpleDateFormat sf = new SimpleDateFormat(DATE_FORMATE_STRING_A);
        Calendar c = Calendar.getInstance();
@@ -666,4 +675,17 @@
        resMonth = tmpDays.divide(monthDay, 4, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(result)).add(preRresMonth).doubleValue();
        return resMonth;
    }
    /**
     * 通过时间秒毫秒数判断两个时间的间隔
     * @param date1
     * @param date2
     * @return
     */
    public static int differentDaysUp(Date date1,Date date2)
    {
        double days = ((date2.getTime() - date1.getTime()) / (1000*3600*24*1.00));
        return new Double(Math.ceil(days)).intValue();
    }
}