From e94e5dbbfc544c558a09fb388e7f4d4341fe8ec4 Mon Sep 17 00:00:00 2001 From: cjl <276999030@qq.com> Date: Thu, 28 Sep 2023 16:59:01 +0800 Subject: [PATCH] ci:添加自有权限 --- screen-common/src/main/java/com/moral/util/DateUtils.java | 32 +++++++++++++++++++++++++++++++- 1 files changed, 31 insertions(+), 1 deletions(-) diff --git a/screen-common/src/main/java/com/moral/util/DateUtils.java b/screen-common/src/main/java/com/moral/util/DateUtils.java index 2de5766..5a51ae9 100644 --- a/screen-common/src/main/java/com/moral/util/DateUtils.java +++ b/screen-common/src/main/java/com/moral/util/DateUtils.java @@ -442,7 +442,7 @@ } /** - * ������������"yyyy-MM-dd HH:mm:ss"������������������������������������������,time2-time1 + * ������������"yyyy-MM-dd"������������������������������������������,time2-time1 * * @param time1 * @param time2 @@ -453,6 +453,20 @@ Date d2 = getDate(time2); return d2.getTime() - d1.getTime(); } + + /** + * ������������"yyyy-MM-dd HH:mm:ss"������������������������������������������,time2-time1 + * + * @param time1 + * @param time2 + * @return + */ + public static long compareDateStrDay(String time1, String time2) { + Date d1 = getDate(time1,DateUtils.yyyy_MM_dd_HH_mm_ss_EN); + Date d2 = getDate(time2,DateUtils.yyyy_MM_dd_HH_mm_ss_EN); + return d2.getTime() - d1.getTime(); + } + /** * ��������������������������������������� @@ -507,6 +521,14 @@ } } + public static boolean isTimeBeforE(Date nows, Date date) { + long hous = nows.getTime() - date.getTime(); + if (hous >= 0) { + return true; + } else { + return false; + } + } /** * ������������������������������������������������������ * @@ -1064,6 +1086,14 @@ return getDate(dateToDateString(cal.getTime(), yyyy_MM_dd_EN)); } + public static Date getLastDayOfCurrMonth(Date time) { + Calendar cal = Calendar.getInstance(); + cal.setTime(time); + cal.add(Calendar.MONTH, 1); + cal.set(Calendar.DAY_OF_MONTH, 0); + return getDate(dateToDateString(cal.getTime(), yyyy_MM_dd_EN)); + } + /** * ��������������������������������������������������� * -- Gitblit v1.8.0