DateTimeFormatter.OfLocalizedPattern(String) 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.
Creates a locale specific formatter derived from the requested template for the ISO chronology.
[Android.Runtime.Register("ofLocalizedPattern", "(Ljava/lang/String;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=37)]
public static Java.Time.Format.DateTimeFormatter OfLocalizedPattern(string requestedTemplate);
[<Android.Runtime.Register("ofLocalizedPattern", "(Ljava/lang/String;)Ljava/time/format/DateTimeFormatter;", "", ApiSince=37)>]
static member OfLocalizedPattern : string -> Java.Time.Format.DateTimeFormatter
Parameters
- requestedTemplate
- String
the requested template, not null
Returns
the formatter based on the requestedTemplate pattern, not null
- Attributes
Remarks
Creates a locale specific formatter derived from the requested template for the ISO chronology. 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.DateTimeFormatter.ofLocalizedPattern.