ChronoPeriod.addTo

Adds this period to the specified temporal object. !(p) This returns a temporal object of the same observable type as the input with this period added. !(p) In most cases, it is clearer to reverse the calling pattern by using {@link Temporal#plus(TemporalAmount)}. !(pre) // these two lines are equivalent, but the second approach is recommended dateTime = thisPeriod.addTo(dateTime); dateTime = dateTime.plus(thisPeriod); </pre> !(p) The specified temporal must have the same chronology as this period. This returns a temporal with the non-zero supported units added. !(p) This instance is immutable and unaffected by this method call.

@param temporal the temporal object to adjust, not null @return an object of the same type with the adjustment made, not null @throws DateTimeException if unable to add @throws ArithmeticException if numeric overflow occurs

interface ChronoPeriod
override
addTo

Meta