指定fotmat,得到二个日期间的间隔天数

@param startDate
@param endDate
@param format

@return

@author zhangbi
507995
public static long getTwoDaysBetweenNumber(String startDate, String endDate, Format format) {
        SimpleDateFormat localFormat = (SimpleDateFormat) format;
        long day = 0;
        try {
            java.util.Date startDay = localFormat.parse(startDate);
            java.util.Date endDay = localFormat.parse(endDate);
            day = (endDay.getTime() - startDay.getTime()) / (24 * 60 * 60 * 1000);
        } catch (Exception e) {
            return 0;
        }
        return day;
    }
453141
public static Calendar parse(final String date, final DateTimeFormatter format) {
		return format.parseDateTime(date).toGregorianCalendar();
	}
439528
public static boolean isBetweenDate(Date startDate, Date endDate, Date specificDate) {
        long startTm = getDateCeil(startDate).getTimeInMillis();
        long endTm = getDateCeil(endDate).getTimeInMillis();
        long specificTm = getDateCeil(specificDate).getTimeInMillis();

        if (startTm <= specificTm && endTm >= specificTm) {
            return true;
        }
        return false;
    }
339456
public static boolean isToday(String date, String format) {
        String now = getFormatDate(SHORT);
        String target = getFormatDate(SHORT, parse(date, format));
        return now.equals(target);
    }
1115208
@Override
    public DateCalculator<E> setStartDate(final E startDate) {
        this.startDate = startDate;
        setCurrentBusinessDate(startDate);
        return this;
    }
284686
public static String getDateString(String format, Date date) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
102962
public Expression<java.util.Date> between(java.util.Date startValue, java.util.Date endValue) {
		SimpleDateFormat formatter = getDateTimeFormatter();
		String valueString = "'" + formatter.format(startValue).concat("Z") + "' AND '" + formatter.format(endValue) + "'";
		return new Expression<java.util.Date>(this, Operation.between, valueString);
	}
593275
public static List<Date> matchedDates(String patternStr, Date start, Date end, int count, boolean isMatchSecond) {
		return matchedDates(patternStr, start.getTime(), end.getTime(), count, isMatchSecond);
	}
928768
public static String format(Date date, DateFormat format) {
		if (null == format || null == date) {
			return null;
		}
		return format.format(date);
	}
148524
public static void isTimeZone(String beginTime, String endTime, String format) {
        DateUtil.parse(beginTime, format);
        DateUtil.parse(endTime, format);
        if (beginTime.compareTo(endTime) > 0) {
            throw new IllegalArgumentException("开始时间必须小于结束时间");
        }
    }
976161
public static List<LocalDate> untilDays(String startDate, String endDate, String pattern) {
        return untilDays(parse(startDate, pattern), parse(endDate, pattern));
    }
161544
public static LinkedHashSet<String> yearAndQuarter(long startDate, long endDate) {
		LinkedHashSet<String> quarters = new LinkedHashSet<>();
		final Calendar cal = calendar(startDate);
		while (startDate <= endDate) {
			// 如果开始时间超出结束时间，让结束时间为开始时间，处理完后结束循环
			quarters.add(yearAndQuarter(cal));

			cal.add(Calendar.MONTH, 3);
			startDate = cal.getTimeInMillis();
		}

		return quarters;
	}
733318
public static Calendar beginOfQuarter(Calendar calendar) {
		calendar.set(Calendar.MONTH, calendar.get(DateField.MONTH.getValue()) / 3 * 3);
		calendar.set(Calendar.DAY_OF_MONTH, 1);
		return beginOfDay(calendar);
	}
1338627
public static boolean isBetweenDate(String startDate, String endDate, Format format, String specificDate) {
        boolean result = false;
        List<String> dateList = getDayListBetween2Day(startDate, endDate, format);
        for (String date : dateList) {
            if (date.equalsIgnoreCase(specificDate)) {
                return true;
            }
        }
        return result;
    }
105349
public static String formatBetween(Date beginDate, Date endDate) {
		return formatBetween(between(beginDate, endDate, DateUnit.MS));
	}
479630
public static Calendar parse(final String date, final String format) {
		return parse(date, DateTimeFormat.forPattern(format));
	}
1169122
public static List<LocalDate> untilDays(LocalDate startDate, LocalDate endDate) {
        long until = startDate.until(endDate, ChronoUnit.DAYS) + 1;
        List<LocalDate> dates = new ArrayList<>();
        for (long i = 0; i < until; i++) {
            dates.add(startDate.plusDays(i));
        }
        return dates;
    }