Language

OffsetDateTime.WithHour(Int32) Method

Definition

Returns a copy of this OffsetDateTime with the hour-of-day altered.

[Android.Runtime.Register("withHour", "(I)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public Java.Time.OffsetDateTime? WithHour(int hour);
[<Android.Runtime.Register("withHour", "(I)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
member this.WithHour : int -> Java.Time.OffsetDateTime

Parameters

hour
Int32

the hour-of-day to set in the result, from 0 to 23

Returns

an OffsetDateTime based on this date-time with the requested hour, not null

Attributes

Remarks

Returns a copy of this OffsetDateTime with the hour-of-day altered. The date and offset do 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.OffsetDateTime.withHour.

Applies to