This method returns a copy of this period with the specified temporal amount added.
package com.logicbig.example.period;
import java.time.Period;
public class PlusExample {
public static void main(String... args) {
Period p1 = Period.of(10, 2, 13);
System.out.println(p1);
Period p2 = Period.of(2, 10, -20);
System.out.println(p2);
Period p3 = p2.plus(p2);
System.out.println(p3);
}
}
Output
P10Y2M13D
P2Y10M-20D
P4Y20M-40D