LocalDate date = LocalDate.parse("2019-08-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"));
LocalDate first = date.with(TemporalAdjusters.firstDayOfMonth());
LocalDate last = date.with(TemporalAdjusters.lastDayOfMonth());
long days = first.until(last, ChronoUnit.DAYS);
System.out.println(days);
System.out.println(first.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
System.out.println(last.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));

相关文章:

  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-11-29
  • 2021-05-19
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2022-01-15
  • 2021-08-17
相关资源
相似解决方案