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. 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.