//判断时间是否在本月之内 public static boolean isInThisMonth(LocalDateTime time) { LocalDate localDate = time.toLocalDate(); LocalDate now = LocalDate.now(); return localDate.isAfter(now.minusMonths(1).with(TemporalAdjusters.lastDayOfMonth())) && localDate.isBefore(now.plusMonths(1).with(TemporalAdjusters.firstDayOfMonth())); }
LocalDate或者LocalDateTime判断是否在本月之内
猜你喜欢
转载自blog.csdn.net/u013282737/article/details/104778445
今日推荐
周排行