|
|
@ -15,19 +15,11 @@ public class TimeUtils { |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static Long getDifferTime(Date nowDate,Date endDate ) { |
|
|
|
public static Long getDifferTime(Date nowDate,Date endDate ) { |
|
|
|
// long nd = 1000 * 24 * 60 * 60L;
|
|
|
|
|
|
|
|
// 获得两个时间的毫秒时间差异
|
|
|
|
|
|
|
|
// long nh = 1000 * 60 * 60L;
|
|
|
|
|
|
|
|
// long diff = endDate.getTime() - nowDate.getTime();
|
|
|
|
|
|
|
|
// BigDecimal s=BigDecimal.valueOf(diff).divide(BigDecimal.valueOf(diff)).setScale(0, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
|
|
// Long hour=s.longValue();
|
|
|
|
|
|
|
|
// return hour;
|
|
|
|
|
|
|
|
long nd = 1000 * 24 * 60 * 60L; |
|
|
|
|
|
|
|
long nh = 1000 * 60 * 60L; |
|
|
|
long nh = 1000 * 60 * 60L; |
|
|
|
// 获得两个时间的毫秒时间差异
|
|
|
|
// 获得两个时间的毫秒时间差异
|
|
|
|
long diff = endDate.getTime() - nowDate.getTime(); |
|
|
|
long diff = endDate.getTime() - nowDate.getTime(); |
|
|
|
// 计算差多少小时
|
|
|
|
// 计算差多少小时
|
|
|
|
long hour = diff % nd / nh; |
|
|
|
long hour = diff/ nh; |
|
|
|
return hour; |
|
|
|
return hour; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|