From 225912f6f9b2fbd999f65c026b542c9436b0f19c Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 5 Jul 2023 15:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B6=88=E7=BC=BA=E6=B5=81?= =?UTF-8?q?=E7=A8=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hnac/hzims/operational/util/TimeUtils.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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; }