DateTimeFormatterBuilder.ofPattern

Creates a formatter using the specified pattern. !(p) This method will create a formatter based on a simple <a href="#patterns">pattern of letters and symbols</a> as described _in the class documentation. For example, {@code d MMM uuuu} will format 2011-12-03 as '3 Dec 2011'. !(p) The formatter will use the {@link Locale#getDefault(Locale.Category) default FORMAT locale}. This can be changed using {@link DateTimeFormatter#withLocale(Locale)} on the returned formatter. Alternatively use the {@link #ofPattern(string, Locale)} variant of this method. !(p) The returned formatter has no override chronology or zone. It uses {@link ResolverStyle#SMART SMART} resolver style.

@param pattern the pattern to use, not null @return the formatter based on the pattern, not null @throws IllegalArgumentException if the pattern is invalid @see DateTimeFormatterBuilder#appendPattern(string)

  1. DateTimeFormatter ofPattern(string pattern)
    class DateTimeFormatterBuilder
    static
    ofPattern
    (
    string pattern
    )
  2. DateTimeFormatter ofPattern(string pattern, Locale locale)

Meta