Period.PlusYears(Int64) Method

Definition

Returns a copy of this period with the specified years added.

[Android.Runtime.Register("plusYears", "(J)Ljava/time/Period;", "", ApiSince=26)]
public Java.Time.Period? PlusYears(long yearsToAdd);
[<Android.Runtime.Register("plusYears", "(J)Ljava/time/Period;", "", ApiSince=26)>]
member this.PlusYears : int64 -> Java.Time.Period

Parameters

yearsToAdd
Int64

the years to add, positive or negative

Returns

a Period based on this period with the specified years added, not null

Attributes

Remarks

Returns a copy of this period with the specified years added. This adds the amount to the years unit in a copy of this period. The months and days units are unaffected. For example, "1 year, 6 months and 3 days" plus 2 years returns "3 years, 6 months and 3 days". This instance is immutable and unaffected by this method call.

Java reference for java.time.Period.plusYears.

Applies to