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);

 

posted @ 2024-09-18 16:44  Fyy发大财  阅读(111)  评论(0)    收藏  举报