修改下架时间——先默认挂3个月
This commit is contained in:
@@ -9,6 +9,7 @@ import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
@@ -246,4 +247,20 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取3个月以后
|
||||
* @param fmt
|
||||
* @return
|
||||
*/
|
||||
public static String getMonthThree(String fmt){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.MONTH, 3);
|
||||
Date now = new Date();
|
||||
Date threeMonthsLater = calendar.getTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(fmt);
|
||||
System.out.println("当前时间:" + sdf.format(now));
|
||||
System.out.println("当前时间+3个月:" + sdf.format(threeMonthsLater));
|
||||
return sdf.format(threeMonthsLater);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user