Language

OffsetTime.Parse Method

Definition

Overloads

Name Description
Parse(ICharSequence)

Obtains an instance of OffsetTime from a text string such as 10:15:30+01:00.

Parse(String)

Parses an ISO time with a UTC offset from a string.

Parse(ICharSequence, DateTimeFormatter)

Obtains an instance of OffsetTime from a text string using a specific formatter.

Parse(String, DateTimeFormatter)

Parses an offset time string with the specified formatter.

Parse(ICharSequence)

Obtains an instance of OffsetTime from a text string such as 10:15:30+01:00.

[Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;)Ljava/time/OffsetTime;", "", ApiSince=26)]
public static Java.Time.OffsetTime? Parse(Java.Lang.ICharSequence? text);
[<Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;)Ljava/time/OffsetTime;", "", ApiSince=26)>]
static member Parse : Java.Lang.ICharSequence -> Java.Time.OffsetTime

Parameters

text
ICharSequence

the text to parse such as "10:15:30+01:00", not null

Returns

the parsed local time, not null

Attributes

Remarks

Obtains an instance of OffsetTime from a text string such as 10:15:30+01:00. The string must represent a valid time and is parsed using DateTimeFormatter.ISO_OFFSET_TIME.

Java reference for java.time.OffsetTime.parse.

Applies to

Parse(String)

Parses an ISO time with a UTC offset from a string.

public static Java.Time.OffsetTime? Parse(string? text);
static member Parse : string -> Java.Time.OffsetTime

Parameters

text
String

The time and offset text, for example 10:15:30+01:00.

Returns

The time and offset read from text.

Remarks

This string overload calls Parse(ICharSequence) and uses IsoOffsetTime.

Applies to

Parse(ICharSequence, DateTimeFormatter)

Obtains an instance of OffsetTime from a text string using a specific formatter.

[Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;Ljava/time/format/DateTimeFormatter;)Ljava/time/OffsetTime;", "", ApiSince=26)]
public static Java.Time.OffsetTime? Parse(Java.Lang.ICharSequence? text, Java.Time.Format.DateTimeFormatter? formatter);
[<Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;Ljava/time/format/DateTimeFormatter;)Ljava/time/OffsetTime;", "", ApiSince=26)>]
static member Parse : Java.Lang.ICharSequence * Java.Time.Format.DateTimeFormatter -> Java.Time.OffsetTime

Parameters

text
ICharSequence

the text to parse, not null

formatter
DateTimeFormatter

the formatter to use, not null

Returns

the parsed offset time, not null

Attributes

Remarks

Obtains an instance of OffsetTime from a text string using a specific formatter. The text is parsed using the formatter, returning a time.

Java reference for java.time.OffsetTime.parse.

Applies to

Parse(String, DateTimeFormatter)

Parses an offset time string with the specified formatter.

public static Java.Time.OffsetTime? Parse(string? text, Java.Time.Format.DateTimeFormatter? formatter);
static member Parse : string * Java.Time.Format.DateTimeFormatter -> Java.Time.OffsetTime

Parameters

text
String

The string that contains the time and offset fields.

formatter
DateTimeFormatter

The formatter that reads the time and offset fields.

Returns

The time and offset read from text.

Remarks

This string overload calls Parse(ICharSequence, DateTimeFormatter). The supplied formatter determines the input format.

Applies to