//获取时间差天数
private static int getDatePoor(Date endDate, Date nowDate) {
Calendar cal = Calendar.getInstance();
cal.setTime(endDate);
long time1 = cal.getTimeInMillis();
cal.setTime(nowDate);
long time2 = cal.getTimeInMillis();
long between_days = (time2 - time1) / (1000 * 3600 * 24);
int parseInt = Integer.parseInt(String.valueOf(between_days));
parseInt = parseInt + 1;
return parseInt;
}
java 通用方法封装
最新推荐文章于 2023-01-29 13:18:11 发布