LocalDateTime 使用记录

1.LocalDateTime 获取指定日期的月初和月末

LocalDateTime firstDayTime = LocalDate.now().withMonth(12).withDayOfMonth(1).atStartOfDay();
System.out.println("firstDayTime: " + firstDayTime);

LocalDateTime lastDayTime = firstDayTime.plusMonths(1);
System.out.println("lastDayTime: " + lastDayTime);

 



posted @ 2020-07-23 13:41  演说家  阅读(220)  评论(0编辑  收藏  举报