获取两个时间之间的天数

//获取两个时间之间的日期
public 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 ;

}

上一篇:js倒计时 天,时,分,秒


下一篇:95JS原生:现在时间和倒计时