LocalDate.WithMonth(Int32) Method

Definition

Returns a copy of this LocalDate with the month-of-year altered.

[Android.Runtime.Register("withMonth", "(I)Ljava/time/LocalDate;", "", ApiSince=26)]
public Java.Time.LocalDate? WithMonth(int month);
[<Android.Runtime.Register("withMonth", "(I)Ljava/time/LocalDate;", "", ApiSince=26)>]
member this.WithMonth : int -> Java.Time.LocalDate

Parameters

month
Int32

the month-of-year to set in the result, from 1 (January) to 12 (December)

Returns

a LocalDate based on this date with the requested month, not null

Attributes

Remarks

Returns a copy of this LocalDate with the month-of-year altered. If the day-of-month is invalid for the year, it will be changed to the last valid day of the month. This instance is immutable and unaffected by this method call.

Java reference for java.time.LocalDate.withMonth.

Applies to