OffsetDateTime.MinusWeeks(Int64) Method

Definition

Returns a copy of this OffsetDateTime with the specified number of weeks subtracted.

[Android.Runtime.Register("minusWeeks", "(J)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public Java.Time.OffsetDateTime? MinusWeeks(long weeks);
[<Android.Runtime.Register("minusWeeks", "(J)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
member this.MinusWeeks : int64 -> Java.Time.OffsetDateTime

Parameters

weeks
Int64

the weeks to subtract, may be negative

Returns

an OffsetDateTime based on this date-time with the weeks subtracted, not null

Attributes

Remarks

Returns a copy of this OffsetDateTime with the specified number of weeks subtracted. This method subtracts the specified amount in weeks from the days field decrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded. For example, 2009-01-07 minus one week would result in 2008-12-31. This instance is immutable and unaffected by this method call.

Java reference for java.time.OffsetDateTime.minusWeeks.

Applies to