LocalDateTime date = LocalDateTime.now();
LocalDateTime firstday = date.with(TemporalAdjusters.firstDayOfMonth());
LocalDateTime lastDay = date.with(TemporalAdjusters.lastDayOfMonth());
System.out.println(“firstday:” + firstday);
System.out.println(“lastDay:” + lastDay);
java8的LocalDateTime获取当前月的第一天与最后一天
最新推荐文章于 2024-08-16 10:07:09 发布