OffsetDateTime.Parse 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| Parse(ICharSequence) |
从文本字符串(如 2007-12-03T10:15:30+01:00)获取 OffsetDateTime 的实例。 |
| Parse(String) | |
| Parse(ICharSequence, DateTimeFormatter) |
使用特定格式化程序从文本字符串中获取 OffsetDateTime 的实例。 |
| Parse(String, DateTimeFormatter) |
Parse(ICharSequence)
从文本字符串(如 2007-12-03T10:15:30+01:00)获取 OffsetDateTime 的实例。
[Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? Parse(Java.Lang.ICharSequence? text);
[<Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member Parse : Java.Lang.ICharSequence -> Java.Time.OffsetDateTime
参数
- text
- ICharSequence
要分析的文本,例如“2007-12-03T10:15:30+01:00”,而不是 null
返回
分析的偏移日期时间,而不是 null
- 特性
注解
从文本字符串(如 2007-12-03T10:15:30+01:00)获取 OffsetDateTime 的实例。 字符串必须表示有效的日期时间,并使用 DateTimeFormatter.ISO_OFFSET_DATE_TIME 进行分析。
Java参考java.time.OffsetDateTime.parse。
适用于
Parse(String)
public static Java.Time.OffsetDateTime? Parse(string? text);
static member Parse : string -> Java.Time.OffsetDateTime
参数
- text
- String
返回
适用于
Parse(ICharSequence, DateTimeFormatter)
使用特定格式化程序从文本字符串中获取 OffsetDateTime 的实例。
[Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;Ljava/time/format/DateTimeFormatter;)Ljava/time/OffsetDateTime;", "", ApiSince=26)]
public static Java.Time.OffsetDateTime? Parse(Java.Lang.ICharSequence? text, Java.Time.Format.DateTimeFormatter? formatter);
[<Android.Runtime.Register("parse", "(Ljava/lang/CharSequence;Ljava/time/format/DateTimeFormatter;)Ljava/time/OffsetDateTime;", "", ApiSince=26)>]
static member Parse : Java.Lang.ICharSequence * Java.Time.Format.DateTimeFormatter -> Java.Time.OffsetDateTime
参数
- text
- ICharSequence
要分析的文本,而不是 null
- formatter
- DateTimeFormatter
要使用的格式化程序,而不是 null
返回
分析的偏移日期时间,而不是 null
- 特性
注解
使用特定格式化程序从文本字符串中获取 OffsetDateTime 的实例。 使用格式化程序分析文本,并返回日期时间。
Java参考java.time.OffsetDateTime.parse。
适用于
Parse(String, DateTimeFormatter)
public static Java.Time.OffsetDateTime? Parse(string? text, Java.Time.Format.DateTimeFormatter? formatter);
static member Parse : string * Java.Time.Format.DateTimeFormatter -> Java.Time.OffsetDateTime
参数
- text
- String
- formatter
- DateTimeFormatter