Language

MonthDay.WithMonth(Int32) Method

Definition

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

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

Parameters

month
Int32

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

Returns

a MonthDay based on this month-day with the requested month, not null

Attributes

Remarks

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

Java reference for java.time.MonthDay.withMonth.

Applies to