Share via


DateTimeFormatter.WithLocale(Locale) Method

Definition

Returns a copy of this formatter with a new locale.

[Android.Runtime.Register("withLocale", "(Ljava/util/Locale;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=26)]
public Java.Time.Format.DateTimeFormatter? WithLocale (Java.Util.Locale? locale);
[<Android.Runtime.Register("withLocale", "(Ljava/util/Locale;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=26)>]
member this.WithLocale : Java.Util.Locale -> Java.Time.Format.DateTimeFormatter

Parameters

locale
Locale

the new locale, not null

Returns

a formatter based on this formatter with the requested locale, not null

Attributes

Remarks

Returns a copy of this formatter with a new locale.

This is used to lookup any part of the formatter needing specific localization, such as the text or localized pattern.

The locale is stored as passed in, without further processing.

This instance is immutable and unaffected by this method call.

Java documentation for java.time.format.DateTimeFormatter.withLocale(java.util.Locale).

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