From 1be40c8a6695dfe8623687604d7a90a9eb7ccd70 Mon Sep 17 00:00:00 2001
From: xusd <hugeinfo123>
Date: Mon, 14 Oct 2024 17:42:03 +0800
Subject: [PATCH] Merge branch 'feature/gzdyh_20241011_gridaccount' into gzdyh_test
---
dyh-service/dyh-base/src/main/java/cn/huge/base/common/utils/DateUtils.java | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/dyh-service/dyh-base/src/main/java/cn/huge/base/common/utils/DateUtils.java b/dyh-service/dyh-base/src/main/java/cn/huge/base/common/utils/DateUtils.java
index 6bd3cb5..0df7ea2 100644
--- a/dyh-service/dyh-base/src/main/java/cn/huge/base/common/utils/DateUtils.java
+++ b/dyh-service/dyh-base/src/main/java/cn/huge/base/common/utils/DateUtils.java
@@ -174,7 +174,7 @@
* 获取当前时间
* @return Date
*/
- public static Date getMowDate(){
+ public static Date getNowDate(){
return new Date();
}
@@ -971,6 +971,19 @@
}
return year+"年"+month+"月"+day+"日";
}
+
+ /**
+ * 获取两个时间的小时差
+ * */
+ public static Integer getDifferHour(Date time1,Date time2){
+ if(ObjectUtils.isNotEmpty(time1) && ObjectUtils.isNotEmpty(time2)){
+ long housrs = 1000 * 60 * 60;
+ long differ = time1.getTime() - time2.getTime();
+ long housr = differ / housrs;
+ return Integer.valueOf(String.valueOf(housr));
+ }
+ return 0;
+ }
}
/**
* -------------------_ooOoo_-------------------
--
Gitblit v1.8.0