From 6073d90503f964381788e3cf40c6af9bef7faf68 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期五, 22 十一月 2024 10:22:15 +0800 Subject: [PATCH] 最新版本541200007 --- server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 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 c03cf47..f36958d 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 @@ -460,7 +460,7 @@ * @return String * @throws Exception */ - public static String getPlusTime(Date date) throws Exception { + public static String getPlusTime(Date date) { if (date == null) return null; try { @@ -1634,6 +1634,13 @@ public static String getFirstDayOfThisMonth() { try { return getNowShortDate().substring(0, 6) + "01"; + } catch (Exception e) { + return ""; + } + } + public static String getFirstDayCurrentMonth() { + try { + return getDateLong(new Date()).substring(0, 7) + "-01"; } catch (Exception e) { return ""; } @@ -3029,6 +3036,12 @@ calendar.add(Calendar.DATE, days);// return calendar.getTime(); } + public static Date addMonthToDate(Date date, int month) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.MONTH, month);// + return calendar.getTime(); + } public static String afterDateToStr(Integer days){ Date date = new Date(); -- Gitblit v1.9.3