Language

IChronoZonedDateTime.ITemporal.Minus Method

Definition

Overloads

Name Description
ITemporal.Minus(Int64, ITemporalUnit)

Returns an object of the same type as this object with the specified period subtracted.

ITemporal.Minus(ITemporalAmount)

Returns an object of the same type as this object with an amount subtracted.

ITemporal.Minus(Int64, ITemporalUnit)

Returns an object of the same type as this object with the specified period subtracted.

[Android.Runtime.Register("minus", "(JLjava/time/temporal/TemporalUnit;)Ljava/time/chrono/ChronoZonedDateTime;", "GetMinus_JLjava_time_temporal_TemporalUnit_Handler:Java.Time.Chrono.IChronoZonedDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
override sealed Java.Time.Temporal.ITemporal? ITemporal.Minus(long amountToSubtract, Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("minus", "(JLjava/time/temporal/TemporalUnit;)Ljava/time/chrono/ChronoZonedDateTime;", "GetMinus_JLjava_time_temporal_TemporalUnit_Handler:Java.Time.Chrono.IChronoZonedDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Java.Time.Temporal.ITemporal.Minus : int64 * Java.Time.Temporal.ITemporalUnit -> Java.Time.Temporal.ITemporal
override this.Java.Time.Temporal.ITemporal.Minus : int64 * Java.Time.Temporal.ITemporalUnit -> Java.Time.Temporal.ITemporal

Parameters

amountToSubtract
Int64

the amount of the specified unit to subtract, may be negative

unit
ITemporalUnit

the unit of the amount to subtract, not null

Returns

an object of the same type with the specified period subtracted, not null

Implements

Attributes

Remarks

Returns an object of the same type as this object with the specified period subtracted. This method returns a new object based on this one with the specified period subtracted. For example, on a LocalDate, this could be used to subtract a number of years, months or days. The returned object will have the same observable type as this object. In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st March, then subtracting one month would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.

Java reference for java.time.chrono.ChronoZonedDateTime.minus.

Applies to

ITemporal.Minus(ITemporalAmount)

Returns an object of the same type as this object with an amount subtracted.

[Android.Runtime.Register("minus", "(Ljava/time/temporal/TemporalAmount;)Ljava/time/chrono/ChronoZonedDateTime;", "GetMinus_Ljava_time_temporal_TemporalAmount_Handler:Java.Time.Chrono.IChronoZonedDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
override sealed Java.Time.Temporal.ITemporal? ITemporal.Minus(Java.Time.Temporal.ITemporalAmount? amount);
[<Android.Runtime.Register("minus", "(Ljava/time/temporal/TemporalAmount;)Ljava/time/chrono/ChronoZonedDateTime;", "GetMinus_Ljava_time_temporal_TemporalAmount_Handler:Java.Time.Chrono.IChronoZonedDateTime, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member Java.Time.Temporal.ITemporal.Minus : Java.Time.Temporal.ITemporalAmount -> Java.Time.Temporal.ITemporal
override this.Java.Time.Temporal.ITemporal.Minus : Java.Time.Temporal.ITemporalAmount -> Java.Time.Temporal.ITemporal

Parameters

amount
ITemporalAmount

the amount to subtract, not null

Returns

an object of the same type with the specified adjustment made, not null

Implements

Attributes

Remarks

Returns an object of the same type as this object with an amount subtracted. This adjusts this temporal, subtracting according to the rules of the specified amount. The amount is typically a Period but may be any other type implementing the TemporalAmount interface, such as Duration.

date = date.minus(period);               // subtract a Period instance
date = date.minus(duration);             // subtract a Duration instance
date = date.minus(workingDays(6));       // example user-written workingDays method

Note that calling plus followed by minus is not guaranteed to return the same date-time.

Java reference for java.time.chrono.ChronoZonedDateTime.minus.

Applies to