基本的 LocalDates
給定的年 - 月 - 日:
LocalDate oneJanuaryNineteenSixty = new LocalDate(1960,1,1);
今天的日期:
LocalDate today = LocalDate.now()
明天:
LocalDate tomorrow = LocalDate.now().plusDays(1);
昨天:
LocalDate yesterday = LocalDate.now().minusDays(1);
兩週前:
LocalDate twoWeeksAgo = LocalDate.now().minusWeeks(2);
1960-01-01 之前九個月:
LocalDate conception = new LocalDate(1960-01-01).minusMonths(9);
本週六:
LocalDate saturday = LocalDate.now().withDayOfWeek(DateTimeConstants.SATURDAY);