LocalDateTime now = LocalDateTime.now(); //某年的第一天 LocalDateTime firstday = now.with(TemporalAdjusters.firstDayOfYear()).withHour(0).withMinute(0).withSecond(0); //某年的最后一天 LocalDateTime lastDay = now.with(TemporalAdjusters.lastDayOfYear()).withHour(23).withMinute(59).withSecond(59); System.out.println(firstday+"...."+lastDay);
获取一年的第一天和最后一天
最新推荐文章于 2023-11-16 10:10:06 发布