DateTimeFormatter.OfLocalizedTime(FormatStyle) Method

Definition

Returns a locale specific time format for the ISO chronology.

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

Parameters

timeStyle
FormatStyle

the formatter style to obtain, not null

Returns

the time formatter, not null

Attributes

Remarks

Returns a locale specific time format for the ISO chronology.

This returns a formatter that will format or parse a 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.ofLocalizedTime(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