计算两个时间内的日期

@param startDate 开始时间
@param endDate   结束时间
@param pattern   日期格式
@return 日期集合
976161
public static List<LocalDate> untilDays(String startDate, String endDate, String pattern) {
        return untilDays(parse(startDate, pattern), parse(endDate, pattern));
    }
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;
    }
951222
public synchronized static String formatTimeStamp(final Timestamp date, String pattern) {
		if (pattern == null || pattern.equals("")) {
			pattern = JKFormatUtil.DEFAULT_TIMESTAMP_PATTERN;
		}
		return JKFormatUtil.getDateFormatter(pattern).format(date);
	}
879305
public String format(String pattern) {
		long remain = diffInSeconds;

		final Matcher daysMatcher = DAYS.matcher(pattern);
		if (daysMatcher.find()) {
			final String daysFound = daysMatcher.group(1);
			final int d = (int) (remain / DAY_IN_SECONDS);
			remain = remain - d * DAY_IN_SECONDS;
			final String f = String.format("%%0%dd", daysFound.length());
			pattern = pattern.replaceAll(daysFound, String.format(f, d));
		}

		if (pattern.contains("H")) {
			final int h = (int) (remain / HOUR_IN_SECONDS);
			remain = remain - h * HOUR_IN_SECONDS;
			pattern = pattern.replaceAll("H", String.format("%02d", h));
		}

		if (pattern.contains("M")) {
			final int m = (int) (remain / MINUTE_IN_SECONDS);
			remain = remain - m * MINUTE_IN_SECONDS;
			pattern = pattern.replaceAll("M", String.format("%02d", m));
		}

		if (pattern.contains("S")) {
			pattern = pattern.replaceAll("S", String.format("%02d", remain));
		}

		return pattern;
	}
314500
public static java.util.Date parseDate(String strDate, String pattern) {
		try {
			SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.US);
			return parser.parse(strDate);
		} catch (ParseException e) {
			throw new JKException(e);
		}
	}
105349
public static String formatBetween(Date beginDate, Date endDate) {
		return formatBetween(between(beginDate, endDate, DateUnit.MS));
	}
1143524
public static String format(String pattern, Date date) {
	synchronized (data) {
	    Object obj = data.get(pattern);
	    if (obj != null) {
		return ((SimpleDateFormat) obj).format(date);
	    } // print.ln(pattern);
	    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
	    data.put(pattern, sdf);
	    return sdf.format(date);
	}
    }
1260769
public boolean find(Pattern pattern)
    {
        matcher.usePattern(pattern);
        int start = matcher.regionStart();
        if (matcher.find())
        {
            stack.add(new MatchResultImpl(matcher));
            matcher.region(matcher.end(), matcher.regionEnd());
            return true;
        }
        else
        {
            return false;
        }
    }
841375
public static Date formatDate(Date orig, String... patterns) {
        String pattern = TIMESTAMP_PATTERN;
        if (patterns != null && patterns.length > 0
                && StringUtils.isNotBlank(patterns[0])) {
            pattern = patterns[0];
        }
        return parseDate(DateFormatUtils.format(orig, pattern));
    }
1256911
public static String format(final OffsetTime self, String pattern) {
        return self.format(DateTimeFormatter.ofPattern(pattern));
    }
186578
public static String format(final Date date, final String pattern) {
        return format(date, pattern, null, null);
    }
258805
public static long getDaysBetweenIgnoreTime(String startDate, String endDate, Format format) {
        SimpleDateFormat localFormat = (SimpleDateFormat) format;
        try {
            java.util.Date startDay = localFormat.parse(startDate);
            java.util.Date endDay = localFormat.parse(endDate);
            return getDaysBetweenIgnoreTime(startDay, endDay);
        } catch (Exception e) {
            return 0;
        }
    }
1036067
public static DecimalFormat decimalFormat(final String pattern)
    {
        DecimalFormat decFmt = context.get().getDecimalFormat();
        decFmt.applyPattern(pattern);
        return decFmt;
    }
1256082
public static List<Date> matchedDates(String patternStr, Date start, int count, boolean isMatchSecond) {
		return matchedDates(patternStr, start, DateUtil.endOfYear(start), count, isMatchSecond);
	}
293943
public static boolean isIn(Date date, Date beginDate, Date endDate) {
		if (date instanceof DateTime) {
			return ((DateTime) date).isIn(beginDate, endDate);
		} else {
			return new DateTime(date).isIn(beginDate, endDate);
		}
	}
545824
public static Format getDateFormatter(final String pattern) {
		Format format = JKFormatUtil.formatMap.get(pattern);
		if (format == null) {
			format = new SimpleDateFormat(pattern);
			JKFormatUtil.formatMap.put(pattern, format);
		}
		return format;
	}
939619
public static String format(final LocalDate self, String pattern) {
        return self.format(DateTimeFormatter.ofPattern(pattern));
    }