Period.Minus(ITemporalAmount) Method

Definition

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

[Android.Runtime.Register("minus", "(Ljava/time/temporal/TemporalAmount;)Ljava/time/Period;", "", ApiSince=26)]
public Java.Time.Chrono.IChronoPeriod? Minus(Java.Time.Temporal.ITemporalAmount? amountToSubtract);
[<Android.Runtime.Register("minus", "(Ljava/time/temporal/TemporalAmount;)Ljava/time/Period;", "", ApiSince=26)>]
abstract member Minus : Java.Time.Temporal.ITemporalAmount -> Java.Time.Chrono.IChronoPeriod
override this.Minus : Java.Time.Temporal.ITemporalAmount -> Java.Time.Chrono.IChronoPeriod

Parameters

amountToSubtract
ITemporalAmount

the amount to subtract, not null

Returns

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

Implements

Attributes

Remarks

Returns a copy of this period with the specified period subtracted. This operates separately on the years, months and days. No normalization is performed. For example, "1 year, 6 months and 3 days" minus "2 years, 2 months and 2 days" returns "-1 years, 4 months and 1 day". The specified amount is typically an instance of Period. Other types are interpreted using from(TemporalAmount). This instance is immutable and unaffected by this method call.

Java reference for java.time.Period.minus.

Applies to