Browse Source

修复消缺流程bug

zhongwei
tyty 1 year ago
parent
commit
225912f6f9
  1. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java

10
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;
}

Loading…
Cancel
Save