java.time.Period.between() 方法示例


java.time.Period.between() 方法示例

package com.codingdict;

import java.time.LocalDate;
import java.time.Period;

public class PeriodDemo {
   public static void main(String[] args) {

      Period period = Period.between(LocalDate.ofYearDay(2017, 200),
         LocalDate.ofYearDay(2017, 300));

      System.out.println(period);  
   }
}