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