- 1.将YYYY-MM-DD 字符串日期转为Localdate
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 注册日期
LocalDate regTime = LocalDate.parse(regStringTime, dateTimeFormatter);- 2.获取月份的第一天日期和最后一天日期
LocalDate today = LocalDate.now();
//本月的第一天
LocalDate firstDay = LocalDate.of(today.getYear(), today.getMonth(), 1);
//本月的最后一天
LocalDate lastDay = today.with(TemporalAdjusters.lastDayOfMonth());
System.out.println("本月的第一天:" + firstDay.toString() + " 00:00:00");
System.out.println("本月的最后一天:" + lastDay.toString() + " 23:59:59");
















