Share via


ZoneOffset.Of(String) Method

Definition

Obtains an instance of ZoneOffset using the ID.

[Android.Runtime.Register("of", "(Ljava/lang/String;)Ljava/time/ZoneOffset;", "", ApiSince=26)]
public static Java.Time.ZoneOffset? Of (string? offsetId);
[<Android.Runtime.Register("of", "(Ljava/lang/String;)Ljava/time/ZoneOffset;", "", ApiSince=26)>]
static member Of : string -> Java.Time.ZoneOffset

Parameters

offsetId
String

the offset ID, not null

Returns

the zone-offset, not null

Attributes

Remarks

Obtains an instance of ZoneOffset using the ID.

This method parses the string ID of a ZoneOffset to return an instance. The parsing accepts all the formats generated by #getId(), plus some additional formats: <ul> <li>Z - for UTC <li>+h<li>+hh<li>+hh:mm<li>-hh:mm<li>+hhmm<li>-hhmm<li>+hh:mm:ss<li>-hh:mm:ss<li>+hhmmss<li>-hhmmss</ul> Note that &plusmn; means either the plus or minus symbol.

The ID of the returned offset will be normalized to one of the formats described by #getId().

The maximum supported range is from +18:00 to -18:00 inclusive.

Java documentation for java.time.ZoneOffset.of(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to