@@ -0,0 +1,817 @@
+package com.njust.test.java8;%0A%0Aimport java.time.Duration;%0Aimport java.time.LocalDate;%0Aimport java.time.LocalTime;%0Aimport java.time.Period;%0A%0Aimport org.junit.Test;%0A%0Apublic class PeriodAndDurationDemo%0A%7B%0A    /**%0A     * %E5%A4%A9%E6%95%B0:30%0A     * %E5%88%86%E9%92%9F:40%0A     */%0A    @Test%0A    public void test01()%0A    %7B%0A        //1.Period%E5%AF%B9%E4%B8%80%E4%B8%AALocalDate%0A        LocalDate localDate1 = LocalDate.now();%0A        LocalDate localDate2 = LocalDate.of(2020, 11, 11);%0A        Period period = Period.between(localDate1, localDate2);%0A        System.out.println(%22%E5%A4%A9%E6%95%B0:%22 + period.getDays());%0A        %0A        //2.Duration%E5%AF%B9%E5%BA%94LocalTIme%0A        LocalTime localTime1 = LocalTime.now();%0A        LocalTime localTime2 = LocalTime.of(12, 0);%0A        Duration duration = Duration.between(localTime1, localTime2);%0A        System.out.println(%22%E5%88%86%E9%92%9F:%22 + duration.toMinutes());%0A    %7D%0A%7D%0A

Create PeriodAndDurationDemo.java