common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java
public static int diffOfDay(Date date1, Date date2) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(date1.getTime());
        int i = calendar.get(Calendar.DAY_OF_YEAR);
        Calendar calendar2 = Calendar.getInstance();
        calendar2.setTimeInMillis(date2.getTime());
        int i2 = calendar2.get(Calendar.DAY_OF_YEAR);
        return i2 - i;
    }
public static int diffOfDay(Date date1, Date date2) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(date1.getTime());
        int i = calendar.get(Calendar.DAY_OF_YEAR);
        Calendar calendar2 = Calendar.getInstance();
        calendar2.setTimeInMillis(date2.getTime());
        int i2 = calendar2.get(Calendar.DAY_OF_YEAR);
        return i2 - i;
    }
public static int diffOfDay ( Date date1 , Date date2 ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . setTimeInMillis ( date1 . getTime ( ) ) ; int i = calendar . get ( Calendar . DAY_OF_YEAR ) ; Calendar calendar2 = Calendar . getInstance ( ) ; calendar2 . setTimeInMillis ( date2 . getTime ( ) ) ; int i2 = calendar2 . get ( Calendar . DAY_OF_YEAR ) ; return i2 - i ; }
计算日期之间相差多少天

@param date1 较前日期
@param date2 较后日期
@return
计算日期之间相差多少天