From 14c45e5391e0c9bd93d3403986f15f6a034e66ec Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 16 四月 2025 11:29:44 +0800
Subject: [PATCH] 代码初始化
---
server/src/main/java/com/doumee/core/utils/DateUtil.java | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/server/src/main/java/com/doumee/core/utils/DateUtil.java b/server/src/main/java/com/doumee/core/utils/DateUtil.java
index 637e297..17439fd 100644
--- a/server/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -594,12 +594,12 @@
* @return String
* @throws Exception
*/
- public static String getNowMonth() throws Exception {
+ public static Integer getNowMonth() throws Exception {
String nowMonth = "";
try {
String strTemp = getNowLongTime();
nowMonth = strTemp.substring(4, 6);
- return nowMonth;
+ return Integer.valueOf(nowMonth);
} catch (Exception e) {
throw e;
}
@@ -2928,8 +2928,9 @@
// System.out.println(DateUtil.afterMinutesDate(-5));
- System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1)));
-// System.out.println(DateUtil.getBeforMonthStr(new Date(),12));
+// List<String> s = DateUtil.getDayByMonth();
+// System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1)));
+ System.out.println(DateUtil.getNowMonth());
// List<Date> list =getThisMonthDateList();
// for(Date d :list){
@@ -3236,6 +3237,14 @@
return cal.getTime();
}
+ public static Date afterHoursDate(Date date,Integer hours){
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ cal.add(Calendar.HOUR,hours);
+ return cal.getTime();
+ }
+
+
/**
* LocalDateTime to date
* @param now
--
Gitblit v1.9.3