java判断某个时间是否在当前时间之后
// 获取当前时间 Instant now = Instant.now(); Date endTime = new Date(); long endTimeMillis = endTime.getTime(); Instant end = Instant.ofEpochMilli(endTimeMillis);
//true 在当前时间之后 false不在
boolean isAfter = now.isAfter(end);
// 获取当前时间 Instant now = Instant.now(); Date endTime = new Date(); long endTimeMillis = endTime.getTime(); Instant end = Instant.ofEpochMilli(endTimeMillis);
//true 在当前时间之后 false不在
boolean isAfter = now.isAfter(end);