|
@@ -3,11 +3,13 @@ package com.fdkankan.ucenter.util;
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.fdkankan.ucenter.entity.IncrementType;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.joda.time.DateTime;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.ZoneId;
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
|
|
|
public class DateUserUtil {
|
|
@@ -97,4 +99,22 @@ public class DateUserUtil {
|
|
|
.toLocalDateTime().plusMonths(month);
|
|
|
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
|
|
|
}
|
|
|
+
|
|
|
+ public static String AddMinute(Date date, Integer minute){
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat(DEF_FMT);
|
|
|
+ Calendar nowTime = Calendar.getInstance();
|
|
|
+ nowTime.setTime(date);
|
|
|
+ nowTime.add(Calendar.MINUTE, ~minute);
|
|
|
+ return sdf.format(nowTime.getTime());
|
|
|
+ }
|
|
|
+ public static String AddMinute(String date, Integer minute){
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat(DEF_FMT);
|
|
|
+ try {
|
|
|
+ Date time = sdf.parse(date);
|
|
|
+ return AddMinute(time,minute);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return date;
|
|
|
+ }
|
|
|
}
|