Month:
Month june = Month.of(6); //JUNE
Month month = Month.valueOf("January".toUpperCase());
LocalDate localDate1 = Year.now().atMonth(month).atDay(1).with(TemporalAdjusters.lastDayOfMonth(); //2021-01-31
LocalDate localDate2 = Year.now().atMonth(month).atDay(1).with(TemporalAdjusters.firstInMonth(DayOfWeek.SUNDAY));//2021-01-03
LocalDate localDate3 = localDate2.with(TemporalAdjusters.next(DayOfWeek.SUNDAY)); //2021-01-10
int value = month.getValue(); //value = 1
/* LocalDate转Date */
ZoneId zone = ZoneId.systemDefault();
Instant instant = localDate.atStartOfDay().atZone(zone).toInstant();
Date date = Date.from(instant); //2021-01-01 00:00:00
YearMonth:
YearMonth yearMonth = YearMonth.of(2021, 6); //2021-06
ZoneId zone = ZoneId.systemDefault();
Date firstDay = Date.from(yearMonth.atDay(1).atStartOfDay().atZone(zone).toInstant()); //2021-06-01 00:00:00
Date lastDate = Date.from(yearMonth.atEndOfMonth().atTime(23, 59, 59).atZone(zone).toInstant()); //2021-06-30 23:59:59