Period.MinusMonths(Int64) Method

Definition

Returns a copy of this period with the specified months subtracted.

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

Parameters

monthsToSubtract
Int64

the months to subtract, positive or negative

Returns

a Period based on this period with the specified months subtracted, not null

Attributes

Remarks

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

Java reference for java.time.Period.minusMonths.

Applies to