Datetime formatting is performed by the {@link DateTimeFormatter} class.Three classes provide factory methods to create formatters, and this is one. The others are {@link DateTimeFormat} and {@link ISODateTimeFormat}.
DateTimeFormatterBuilder is used for constructing formatters which are then used to print or parse. The formatters are built by appending specific fields or other formatters to an instance of this builder.
For example, a formatter that prints month and year, like "January 1970", can be constructed as follows:
DateTimeFormatter monthAndYear = new DateTimeFormatterBuilder() .appendMonthOfYearText() .appendLiteral(' ') .appendYear(4, 4) .toFormatter();
DateTimeFormatterBuilder itself is mutable and not thread-safe, but the formatters that it builds are thread-safe and immutable. @author Brian S O'Neill @author Stephen Colebourne @author Fredrik Borgh @since 1.0 @see DateTimeFormat @see ISODateTimeFormat
|
|
|
|