From 1b2ce0a15e0d441042817feceaa16184a885165f Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期四, 10 八月 2023 11:00:25 +0800 Subject: [PATCH] 1 --- src/main/java/com/yssh/utils/DateUtils.java | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/yssh/utils/DateUtils.java b/src/main/java/com/yssh/utils/DateUtils.java index bd91779..192ce60 100644 --- a/src/main/java/com/yssh/utils/DateUtils.java +++ b/src/main/java/com/yssh/utils/DateUtils.java @@ -212,9 +212,6 @@ return times; } - /** - * - */ public static Map<Date, Date> segmentationDateByTimeQuantum(Date startDate, Date endDate, int timeQuantum, int dateType) { LinkedHashMap<Date, Date> result = new LinkedHashMap<Date, Date>(); long startTimeMillisecond = startDate.getTime(); @@ -245,9 +242,17 @@ } /** + * 鍓櫎鏃ユ湡鐨勬椂闂撮儴鍒� + */ + public static Date trimTime(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + + return dateTime(YYYY_MM_DD_HH_MM_SS, parseDateToStr(YYYY_MM_DD, cal.getTime()) + " 00:00:00"); + } + + /** * 鑾峰彇鏈湀绗竴澶� - * - * @return String **/ public static Date getMonthStart(Date date) { Calendar cal = Calendar.getInstance(); @@ -259,8 +264,6 @@ /** * 鑾峰彇鏈湀鏈�鍚庝竴澶� - * - * @return String **/ public static Date getMonthEnd(Date date) { Calendar cal = Calendar.getInstance(); -- Gitblit v1.9.3