|
|
@ -8,6 +8,7 @@ import java.time.LocalDateTime; |
|
|
|
import java.time.LocalTime; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.time.ZonedDateTime; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Date; |
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils; |
|
|
|
|
|
|
@ -184,4 +185,15 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils |
|
|
|
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault()); |
|
|
|
return Date.from(zdt.toInstant()); |
|
|
|
} |
|
|
|
/** |
|
|
|
* 获取当前时间,time分钟后的时间 |
|
|
|
*/ |
|
|
|
public static Date getObtainDateAfter(int time){ |
|
|
|
Date now = new Date(); |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
calendar.setTime(now); |
|
|
|
calendar.add(Calendar.MINUTE, time); |
|
|
|
Date fiveMinutesLater = calendar.getTime(); |
|
|
|
return fiveMinutesLater; |
|
|
|
} |
|
|
|
} |
|
|
|