Dil

ZoneRules.IsValidOffset(LocalDateTime, ZoneOffset) Method

Definition

Checks whether the offset date-time is valid for these rules.

[Android.Runtime.Register("isValidOffset", "(Ljava/time/LocalDateTime;Ljava/time/ZoneOffset;)Z", "", ApiSince=26)]
public bool IsValidOffset(Java.Time.LocalDateTime? localDateTime, Java.Time.ZoneOffset? offset);
[<Android.Runtime.Register("isValidOffset", "(Ljava/time/LocalDateTime;Ljava/time/ZoneOffset;)Z", "", ApiSince=26)>]
member this.IsValidOffset : Java.Time.LocalDateTime * Java.Time.ZoneOffset -> bool

Parameters

localDateTime
LocalDateTime

The local date-time to check. Fixed-offset rules may ignore null; variable rules do not.

offset
ZoneOffset

The offset to check; null returns false.

Returns

true if the offset date-time is valid for these rules; otherwise, false.

Attributes

Exceptions

Thrown if localDateTime is null and the rules are not fixed-offset.

Remarks

Checks if the offset date-time is valid for these rules. To be valid, the local date-time must not be in a gap and the offset must match one of the valid offsets. This default implementation checks if getValidOffsets(java.time.LocalDateTime) contains the specified offset.

Java reference for java.time.zone.ZoneRules.isValidOffset.

Applies to