Language

ZonedDateTime.MinusYears(Int64) Method

Definition

Returns a copy of this ZonedDateTime with the specified number of years subtracted.

[Android.Runtime.Register("minusYears", "(J)Ljava/time/ZonedDateTime;", "", ApiSince=26)]
public Java.Time.ZonedDateTime? MinusYears(long years);
[<Android.Runtime.Register("minusYears", "(J)Ljava/time/ZonedDateTime;", "", ApiSince=26)>]
member this.MinusYears : int64 -> Java.Time.ZonedDateTime

Parameters

years
Int64

the years to subtract, may be negative

Returns

a ZonedDateTime based on this date-time with the years subtracted, not null

Attributes

Remarks

Returns a copy of this ZonedDateTime with the specified number of years subtracted. This operates on the local time-line, subtracting years to the local date-time. This is then converted back to a ZonedDateTime, using the zone ID to obtain the offset. When converting back to ZonedDateTime, if the local date-time is in an overlap, then the offset will be retained if possible, otherwise the earlier offset will be used. If in a gap, the local date-time will be adjusted forward by the length of the gap. This instance is immutable and unaffected by this method call.

Java reference for java.time.ZonedDateTime.minusYears.

Applies to