diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java index 0ee89bc..74323ac 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java @@ -15,19 +15,11 @@ public class TimeUtils { * @return */ 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 diff = endDate.getTime() - nowDate.getTime(); // 计算差多少小时 - long hour = diff % nd / nh; + long hour = diff/ nh; return hour; }