語言

OffsetTime.Parse 方法

定義

多載

名稱 Description
Parse(ICharSequence)

可從文字串(如 10:15:30+01:00)取得 OffsetTime 實例。

Parse(String)
Parse(ICharSequence, DateTimeFormatter)

使用特定格式化器從文字字串取得 OffsetTime 實例。

Parse(String, DateTimeFormatter)

Parse(ICharSequence)

可從文字串(如 10:15:30+01:00)取得 OffsetTime 實例。

[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

參數

text
ICharSequence

要解析的文字,例如「10:15:30+01:00」,而非空

傳回

解析後的當地時間,非零時間

屬性

備註

可從文字串(如 10:15:30+01:00)取得 OffsetTime 實例。 字串必須代表有效時間,並使用 DateTimeFormatter.ISO_OFFSET_TIME 進行解析。

Java 參考 java.time.OffsetTime.parse

適用於

Parse(String)

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

參數

text
String

傳回

適用於

Parse(ICharSequence, DateTimeFormatter)

使用特定格式化器從文字字串取得 OffsetTime 實例。

[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

參數

text
ICharSequence

要解析的文字,而非 null

formatter
DateTimeFormatter

格式化器要用,不是 null

傳回

解析後的偏移時間,而非零

屬性

備註

使用特定格式化器從文字字串取得 OffsetTime 實例。 文本會使用格式化器進行解析,並返回時間。

Java 參考 java.time.OffsetTime.parse

適用於

Parse(String, DateTimeFormatter)

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

參數

text
String
formatter
DateTimeFormatter

傳回

適用於