DateTimeFormatter.OfLocalizedDateTime 方法

定义

重载

名称 说明
OfLocalizedDateTime(FormatStyle)

返回 ISO 时间顺序的区域设置特定日期/时间格式化程序。

OfLocalizedDateTime(FormatStyle, FormatStyle)

返回 ISO 时间顺序的区域设置特定日期和时间格式。

OfLocalizedDateTime(FormatStyle)

返回 ISO 时间顺序的区域设置特定日期/时间格式化程序。

[Android.Runtime.Register("ofLocalizedDateTime", "(Ljava/time/format/FormatStyle;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=26)]
public static Java.Time.Format.DateTimeFormatter? OfLocalizedDateTime(Java.Time.Format.FormatStyle? dateTimeStyle);
[<Android.Runtime.Register("ofLocalizedDateTime", "(Ljava/time/format/FormatStyle;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=26)>]
static member OfLocalizedDateTime : Java.Time.Format.FormatStyle -> Java.Time.Format.DateTimeFormatter

参数

dateTimeStyle
FormatStyle

要获取的格式化程序样式,而不是 null

返回

日期-时间格式化程序,而不是 null

属性

注解

返回 ISO 时间顺序的区域设置特定日期/时间格式化程序。

这会返回格式化程序,该格式化程序将格式化或分析日期时间。 使用的确切格式模式因区域设置而异。

区域设置由格式化程序确定。 此方法直接返回的格式化程序将使用 .Locale#getDefault(Locale.Category) default FORMAT locale 可以使用此方法的结果控制 DateTimeFormatter#withLocale(Locale) withLocale(Locale) 区域设置。

请注意,本地化模式的查找迟缓。 这会 DateTimeFormatter 保留所需的样式和区域设置,并按需查找所需的模式。

返回的格式化程序具有 ISO 的计时表,以确保正确转换其他日历系统中的日期。 它没有替代区域,并且使用 ResolverStyle#SMART SMART 解析程序样式。 样式FULLLONG通常需要时区。 使用这些样式进行格式设置时,ZoneIdZonedDateTime必须使用或 DateTimeFormatter#withZone.

适用于 . 的 java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

OfLocalizedDateTime(FormatStyle, FormatStyle)

返回 ISO 时间顺序的区域设置特定日期和时间格式。

[Android.Runtime.Register("ofLocalizedDateTime", "(Ljava/time/format/FormatStyle;Ljava/time/format/FormatStyle;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=26)]
public static Java.Time.Format.DateTimeFormatter? OfLocalizedDateTime(Java.Time.Format.FormatStyle? dateStyle, Java.Time.Format.FormatStyle? timeStyle);
[<Android.Runtime.Register("ofLocalizedDateTime", "(Ljava/time/format/FormatStyle;Ljava/time/format/FormatStyle;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=26)>]
static member OfLocalizedDateTime : Java.Time.Format.FormatStyle * Java.Time.Format.FormatStyle -> Java.Time.Format.DateTimeFormatter

参数

dateStyle
FormatStyle

要获取的日期格式化程序样式,而不是 null

timeStyle
FormatStyle

要获取的时间格式化程序样式,而不是 null

返回

日期、时间或日期时间格式化程序,而不是 null

属性

注解

返回 ISO 时间顺序的区域设置特定日期和时间格式。

这会返回格式化程序,该格式化程序将格式化或分析日期时间。 使用的确切格式模式因区域设置而异。

区域设置由格式化程序确定。 此方法直接返回的格式化程序将使用 .Locale#getDefault() default FORMAT locale 可以使用此方法的结果控制 DateTimeFormatter#withLocale(Locale) withLocale(Locale) 区域设置。

请注意,本地化模式的查找迟缓。 这会 DateTimeFormatter 保留所需的样式和区域设置,并按需查找所需的模式。

返回的格式化程序具有 ISO 的计时表,以确保正确转换其他日历系统中的日期。 它没有替代区域,并且使用 ResolverStyle#SMART SMART 解析程序样式。 样式FULLLONG通常需要时区。 使用这些样式进行格式设置时,ZoneIdZonedDateTime必须使用或 DateTimeFormatter#withZone.

适用于 . 的 java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle, java.time.format.FormatStyle)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于