LocalDateTime With()操作指南
可填充参数类型
TemporalAdjusters 实现类(日期操作)、TemporalField 类(指定值)都可以填充
LocalDateTime now = LocalDateTime.now();
//一年中的五月
LocalDateTime may = now.with(Month.MAY);
//月的某一天
LocalDateTime dayOfMonth = now.with(ChronoField.DAY_OF_MONTH, 20);
//月的第一天
LocalDateTime firstDayOfMonth = now.with(TemporalAdjusters.firstDayOfMonth());
System.out.println("一年中的五月"+may);
System.out.println("月的某一天"+dayOfMonth);
System.out.println("月的第一天"+firstDayOfMonth);