From 3c403cfa2a03e3ec6d3b0e4ccb9a38c552e16d0d Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 20 五月 2024 16:57:09 +0800
Subject: [PATCH] ''
---
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java | 28 +++++++++++++++++++++++++---
1 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
index d68a093..269002c 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -2402,6 +2402,16 @@
return new Timestamp(System.currentTimeMillis());
}
}
+ public static Date getDateFromString2(String strDate) {
+ if (StringUtils.isEmpty(strDate)) {
+ return null;
+ }
+ try {
+ return sdfLongTimePlus.parse(strDate);
+ } catch (Exception ex) {
+ return null;
+ }
+ }
// -----------------------------------------------------------------------
@@ -2839,9 +2849,9 @@
public static void main(String[] args) {
try {
- Date date = getISO8601DateByStr("2024-04-15T07:46:36.014+08:00");
- Date date1 = getISO8601DateByStr("2024-06-14T08:46:36.014+08:00");
- System.out.println(daysBetweenDates11(date1,date)+1);
+// Date date = getISO8601DateByStr("2024-04-15T07:46:36.014+08:00");
+// Date date1 = getISO8601DateByStr("2024-06-14T08:46:36.014+08:00");
+ System.out.println(DateUtil.afterMinutesDate(-5));
} catch (Exception ex) {
ex.printStackTrace();
@@ -3098,6 +3108,18 @@
}
/**
+ * X 鍒嗛挓鍚庢椂闂�
+ * @param minutes
+ * @return
+ */
+ public static Date afterMinutesDate(Date date,Integer minutes){
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ cal.add(Calendar.MINUTE,minutes);
+ return cal.getTime();
+ }
+
+ /**
* LocalDateTime to date
* @param now
* @return
--
Gitblit v1.9.3