Share via


DateTimeFormatter.OfLocalizedDateTime Method

Definition

Overloads

OfLocalizedDateTime(FormatStyle)

Returns a locale specific date-time formatter for the ISO chronology.

OfLocalizedDateTime(FormatStyle, FormatStyle)

Returns a locale specific date and time format for the ISO chronology.

OfLocalizedDateTime(FormatStyle)

Returns a locale specific date-time formatter for the ISO chronology.

[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

Parameters

dateTimeStyle
FormatStyle

the formatter style to obtain, not null

Returns

the date-time formatter, not null

Attributes

Remarks

Returns a locale specific date-time formatter for the ISO chronology.

This returns a formatter that will format or parse a date-time. The exact format pattern used varies by locale.

The locale is determined from the formatter. The formatter returned directly by this method will use the Locale#getDefault(Locale.Category) default FORMAT locale. The locale can be controlled using DateTimeFormatter#withLocale(Locale) withLocale(Locale) on the result of this method.

Note that the localized pattern is looked up lazily. This DateTimeFormatter holds the style required and the locale, looking up the pattern required on demand.

The returned formatter has a chronology of ISO set to ensure dates in other calendar systems are correctly converted. It has no override zone and uses the ResolverStyle#SMART SMART resolver style. The FULL and LONG styles typically require a time-zone. When formatting using these styles, a ZoneId must be available, either by using ZonedDateTime or DateTimeFormatter#withZone.

Java documentation for java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

OfLocalizedDateTime(FormatStyle, FormatStyle)

Returns a locale specific date and time format for the ISO chronology.

[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

Parameters

dateStyle
FormatStyle

the date formatter style to obtain, not null

timeStyle
FormatStyle

the time formatter style to obtain, not null

Returns

the date, time or date-time formatter, not null

Attributes

Remarks

Returns a locale specific date and time format for the ISO chronology.

This returns a formatter that will format or parse a date-time. The exact format pattern used varies by locale.

The locale is determined from the formatter. The formatter returned directly by this method will use the Locale#getDefault() default FORMAT locale. The locale can be controlled using DateTimeFormatter#withLocale(Locale) withLocale(Locale) on the result of this method.

Note that the localized pattern is looked up lazily. This DateTimeFormatter holds the style required and the locale, looking up the pattern required on demand.

The returned formatter has a chronology of ISO set to ensure dates in other calendar systems are correctly converted. It has no override zone and uses the ResolverStyle#SMART SMART resolver style. The FULL and LONG styles typically require a time-zone. When formatting using these styles, a ZoneId must be available, either by using ZonedDateTime or DateTimeFormatter#withZone.

Java documentation for java.time.format.DateTimeFormatter.ofLocalizedDateTime(java.time.format.FormatStyle, java.time.format.FormatStyle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to