Language

LocalDateTime.WithDayOfMonth(Int32) Method

Definition

Returns a copy of this LocalDateTime with the day-of-month altered.

[Android.Runtime.Register("withDayOfMonth", "(I)Ljava/time/LocalDateTime;", "", ApiSince=26)]
public Java.Time.LocalDateTime? WithDayOfMonth(int dayOfMonth);
[<Android.Runtime.Register("withDayOfMonth", "(I)Ljava/time/LocalDateTime;", "", ApiSince=26)>]
member this.WithDayOfMonth : int -> Java.Time.LocalDateTime

Parameters

dayOfMonth
Int32

the day-of-month to set in the result, from 1 to 28-31

Returns

a LocalDateTime based on this date-time with the requested day, not null

Attributes

Remarks

Returns a copy of this LocalDateTime with the day-of-month altered. If the resulting date-time is invalid, an exception is thrown. The time does not affect the calculation and will be the same in the result. This instance is immutable and unaffected by this method call.

Java reference for java.time.LocalDateTime.withDayOfMonth.

Applies to