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


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

package com.codingdict;

import java.time.Period;

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

      Period period = Period.of(10,5,2);
      System.out.println(period.getDays());
      Period period1 = Period.of(5,5,2);
      System.out.println(period1.getDays());
      System.out.println(period.minus(period1).getDays());
   }
}