ZoneRules.IsValidOffset(LocalDateTime, ZoneOffset) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. null may be ignored if the rules have no historic wall-offset transitions.
- offset
- ZoneOffset
The offset to check. If it is null, the method returns false or throws a NullPointerException.
Returns
true if the offset date-time is valid for these rules; otherwise, false.
- Attributes
Exceptions
Thrown if localDateTime is null and the rules have historic wall-offset transitions. The Android 13 through 17 implementations also throw if offset is null and the local date-time is in a gap or overlap. Runtime updates can change this behavior.
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.