|
@@ -2,7 +2,9 @@ package com.fdkankan.ucenter.util;
|
|
|
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.fdkankan.ucenter.common.MailUtil;
|
|
|
import com.fdkankan.ucenter.entity.IncrementType;
|
|
|
+import com.fdkankan.ucenter.entity.ScenePro;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
|
|
@@ -33,6 +35,9 @@ public class DateUserUtil {
|
|
|
public static String getDate(Date time){
|
|
|
return new SimpleDateFormat(DEF_FMT).format(time);
|
|
|
}
|
|
|
+ public static String getDate(Date time,String fmt){
|
|
|
+ return new SimpleDateFormat(fmt).format(time);
|
|
|
+ }
|
|
|
public static String getZeroDate(){
|
|
|
return new SimpleDateFormat(DAY_FMT).format(new Date()) +" 00:00:00";
|
|
|
}
|
|
@@ -117,4 +122,19 @@ public class DateUserUtil {
|
|
|
}
|
|
|
return date;
|
|
|
}
|
|
|
+
|
|
|
+ public static String getLastZeroTime(String endTime) {
|
|
|
+ try {
|
|
|
+ Date date = DateUserUtil.getDate(endTime);
|
|
|
+ String date1 = DateUserUtil.getDate(date, DateUserUtil.DAY_FMT);
|
|
|
+ return date1 + " 23:59:59";
|
|
|
+ }catch ( Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return endTime;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ System.out.println(getLastZeroTime("2023-03-01 00:00:00"));
|
|
|
+ }
|
|
|
}
|