DateTimeFormatterBuilder.AppendLocalized Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AppendLocalized(String) |
Appends a localized pattern to the formatter using the requested template. |
| AppendLocalized(FormatStyle, FormatStyle) |
Appends a localized date-time pattern to the formatter. |
AppendLocalized(String)
Appends a localized pattern to the formatter using the requested template.
[Android.Runtime.Register("appendLocalized", "(Ljava/lang/String;)Ljava/time/format/DateTimeFormatterBuilder;", "", ApiSince=37)]
public Java.Time.Format.DateTimeFormatterBuilder AppendLocalized(string requestedTemplate);
[<Android.Runtime.Register("appendLocalized", "(Ljava/lang/String;)Ljava/time/format/DateTimeFormatterBuilder;", "", ApiSince=37)>]
member this.AppendLocalized : string -> Java.Time.Format.DateTimeFormatterBuilder
Parameters
- requestedTemplate
- String
the requested template to use, not null
Returns
this, for chaining, not null
- Attributes
Remarks
The localized pattern is looked up when needed using the requested template, the formatter's locale, and the effective chronology. The localized section can format a date, a time, or a date-time. During formatting, the chronology comes from the temporal object, or ISO if it has no chronology; a formatter override set by WithChronology(IChronology) takes precedence. During parsing, an already parsed chronology is used; otherwise the formatter's chronology is used, or ISO if it has none.
The requested template is a series of typical pattern symbols in canonical order from the largest date or time unit to the smallest, which can be expressed with the following regular expression:
"G{0,5}" + // Era
"y*" + // Year
"Q{0,5}" + // Quarter
"M{0,5}" + // Month
"w*" + // Week of Week Based Year
"E{0,5}" + // Day of Week
"d{0,2}" + // Day of Month
"B{0,5}" + // Period/AmPm of Day
"[hHjC]{0,2}" + // Hour of Day/AmPm (refer to LDML for 'j' and 'C')
"m{0,2}" + // Minute of Hour
"s{0,2}" + // Second of Minute
"[vz]{0,4}" // Zone
All pattern symbols are optional, and each pattern symbol represents a field, for example, 'M' represents the Month field. The number of the pattern symbol letters follows the same presentation, such as "number" or "text" as in the Patterns for Formatting and Parsing section of DateTimeFormatter. Other pattern symbols in the requested template are invalid.
Java reference for java.time.format.DateTimeFormatterBuilder.appendLocalized.
Applies to
AppendLocalized(FormatStyle, FormatStyle)
Appends a localized date-time pattern to the formatter.
[Android.Runtime.Register("appendLocalized", "(Ljava/time/format/FormatStyle;Ljava/time/format/FormatStyle;)Ljava/time/format/DateTimeFormatterBuilder;", "", ApiSince=26)]
public Java.Time.Format.DateTimeFormatterBuilder? AppendLocalized(Java.Time.Format.FormatStyle? dateStyle, Java.Time.Format.FormatStyle? timeStyle);
[<Android.Runtime.Register("appendLocalized", "(Ljava/time/format/FormatStyle;Ljava/time/format/FormatStyle;)Ljava/time/format/DateTimeFormatterBuilder;", "", ApiSince=26)>]
member this.AppendLocalized : Java.Time.Format.FormatStyle * Java.Time.Format.FormatStyle -> Java.Time.Format.DateTimeFormatterBuilder
Parameters
- dateStyle
- FormatStyle
the date style to use, null means no date required
- timeStyle
- FormatStyle
the time style to use, null means no time required
Returns
this, for chaining, not null
- Attributes
Remarks
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.