Appends the elements defined by the specified pattern to the builder.
!(p)
All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters.
The characters '#', '{' and '}' are reserved for future use.
The characters '[' and ']' indicate optional patterns.
The following pattern letters are defined:
!(pre)
Symbol Meaning Presentation Examples
w 1 append special localized WeekFields element for numeric week-of-year
ww 2 append special localized WeekFields element for numeric week-of-year, zero-padded
W 1 append special localized WeekFields element for numeric week-of-month
d 1 appendValue(ChronoField.DAY_OF_MONTH)
dd 2 appendValue(ChronoField.DAY_OF_MONTH, 2)
D 1 appendValue(ChronoField.DAY_OF_YEAR)
DD 2 appendValue(ChronoField.DAY_OF_YEAR, 2, 3, SignStyle.NOT_NEGATIVE)
DDD 3 appendValue(ChronoField.DAY_OF_YEAR, 3)
F 1 appendValue(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH)
g..g 1..n appendValue(JulianFields.MODIFIED_JULIAN_DAY, n, 19, SignStyle.NORMAL)
E 1 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT)
EE 2 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT)
EEE 3 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT)
EEEE 4 appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL)
EEEEE 5 appendText(ChronoField.DAY_OF_WEEK, TextStyle.NARROW)
e 1 append special localized WeekFields element for numeric day-of-week
ee 2 append special localized WeekFields element for numeric day-of-week, zero-padded
eee 3 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT)
eeee 4 appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL)
eeeee 5 appendText(ChronoField.DAY_OF_WEEK, TextStyle.NARROW)
c 1 append special localized WeekFields element for numeric day-of-week
ccc 3 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT_STANDALONE)
cccc 4 appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL_STANDALONE)
ccccc 5 appendText(ChronoField.DAY_OF_WEEK, TextStyle.NARROW_STANDALONE)
</pre>
!(p)
!(b)Time fields</b>: Pattern letters to output a time.
!(pre)
Pattern Count Equivalent builder methods
a1appendText(ChronoField.AMPM_OF_DAY, TextStyle.SHORT)
h1appendValue(ChronoField.CLOCK_HOUR_OF_AMPM)
hh2appendValue(ChronoField.CLOCK_HOUR_OF_AMPM, 2)
H1appendValue(ChronoField.HOUR_OF_DAY)
HH2appendValue(ChronoField.HOUR_OF_DAY, 2)
k1appendValue(ChronoField.CLOCK_HOUR_OF_DAY)
kk2appendValue(ChronoField.CLOCK_HOUR_OF_DAY, 2)
K1appendValue(ChronoField.HOUR_OF_AMPM)
KK2appendValue(ChronoField.HOUR_OF_AMPM, 2)
m1appendValue(ChronoField.MINUTE_OF_HOUR)
mm2appendValue(ChronoField.MINUTE_OF_HOUR, 2)
s1appendValue(ChronoField.SECOND_OF_MINUTE)
ss2appendValue(ChronoField.SECOND_OF_MINUTE, 2)
S..S1..nappendFraction(ChronoField.NANO_OF_SECOND, n, n, false)
A..A1..nappendValue(ChronoField.MILLI_OF_DAY, n, 19, SignStyle.NOT_NEGATIVE)
n..n1..nappendValue(ChronoField.NANO_OF_SECOND, n, 19, SignStyle.NOT_NEGATIVE)
N..N1..nappendValue(ChronoField.NANO_OF_DAY, n, 19, SignStyle.NOT_NEGATIVE)
</pre>
!(p)
!(b)ZoneID</b>: Patternletterstooutput {@codeZoneId}.
!(pre)
PatternCountEquivalentbuildermethods
[ 1 optionalStart()
] 1 optionalEnd()
p..p 1..n padNext(n)
</pre>
!(p)
Any sequence of letters not specified above, unrecognized letter or
reserved character will throw an exception.
Future versions may add to the set of patterns.
It is recommended to use single quotes around all characters that you want
to output directly to ensure that future changes do not break your application.
!(p)
Note that the pattern string is similar, but not identical, to
{@link java.text.SimpleDateFormat SimpleDateFormat}.
The pattern string is also similar, but not identical, to that defined by the
Unicode Common Locale Data Repository (CLDR/LDML).
Pattern letters 'X' and 'u' are aligned with Unicode CLDR/LDML.
By contrast, {@code SimpleDateFormat} uses 'u' for the numeric day of week.
Pattern letters 'y' and 'Y' parse years of two digits and more than 4 digits differently.
Pattern letters 'n', 'A', 'N', and 'p' are added.
Number types will reject large numbers.
@param pattern the pattern to add, not null
@return this, for chaining, not null
@throws IllegalArgumentException if the pattern is invalid
Appends the elements defined by the specified pattern to the builder. !(p) All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The characters '#', '{' and '}' are reserved for future use. The characters '[' and ']' indicate optional patterns. The following pattern letters are defined: !(pre) Symbol Meaning Presentation Examples
G 1 appendText(ChronoField.ERA, TextStyle.SHORT) GG 2 appendText(ChronoField.ERA, TextStyle.SHORT) GGG 3 appendText(ChronoField.ERA, TextStyle.SHORT) GGGG 4 appendText(ChronoField.ERA, TextStyle.FULL) GGGGG 5 appendText(ChronoField.ERA, TextStyle.NARROW)
u 1 appendValue(ChronoField.YEAR, 1, 19, SignStyle.NORMAL) uu 2 appendValueReduced(ChronoField.YEAR, 2, 2000) uuu 3 appendValue(ChronoField.YEAR, 3, 19, SignStyle.NORMAL) u..u 4..n appendValue(ChronoField.YEAR, n, 19, SignStyle.EXCEEDS_PAD) y 1 appendValue(ChronoField.YEAR_OF_ERA, 1, 19, SignStyle.NORMAL) yy 2 appendValueReduced(ChronoField.YEAR_OF_ERA, 2, 2000) yyy 3 appendValue(ChronoField.YEAR_OF_ERA, 3, 19, SignStyle.NORMAL) y..y 4..n appendValue(ChronoField.YEAR_OF_ERA, n, 19, SignStyle.EXCEEDS_PAD) Y 1 append special localized WeekFields element for numeric week-based-year YY 2 append special localized WeekFields element for reduced numeric week-based-year 2 digits YYY 3 append special localized WeekFields element for numeric week-based-year (3, 19, SignStyle.NORMAL) Y..Y 4..n append special localized WeekFields element for numeric week-based-year (n, 19, SignStyle.EXCEEDS_PAD)
Q 1 appendValue(IsoFields.QUARTER_OF_YEAR) QQ 2 appendValue(IsoFields.QUARTER_OF_YEAR, 2) QQQ 3 appendText(IsoFields.QUARTER_OF_YEAR, TextStyle.SHORT) QQQQ 4 appendText(IsoFields.QUARTER_OF_YEAR, TextStyle.FULL) QQQQQ 5 appendText(IsoFields.QUARTER_OF_YEAR, TextStyle.NARROW) q 1 appendValue(IsoFields.QUARTER_OF_YEAR) qq 2 appendValue(IsoFields.QUARTER_OF_YEAR, 2) qqq 3 appendText(IsoFields.QUARTER_OF_YEAR, TextStyle.SHORT_STANDALONE) qqqq 4 appendText(IsoFields.QUARTER_OF_YEAR, TextStyle.FULL_STANDALONE) qqqqq 5 appendText(IsoFields.QUARTER_OF_YEAR, TextStyle.NARROW_STANDALONE)
M 1 appendValue(ChronoField.MONTH_OF_YEAR) MM 2 appendValue(ChronoField.MONTH_OF_YEAR, 2) MMM 3 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.SHORT) MMMM 4 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.FULL) MMMMM 5 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.NARROW) L 1 appendValue(ChronoField.MONTH_OF_YEAR) LL 2 appendValue(ChronoField.MONTH_OF_YEAR, 2) LLL 3 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.SHORT_STANDALONE) LLLL 4 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.FULL_STANDALONE) LLLLL 5 appendText(ChronoField.MONTH_OF_YEAR, TextStyle.NARROW_STANDALONE)
w 1 append special localized WeekFields element for numeric week-of-year ww 2 append special localized WeekFields element for numeric week-of-year, zero-padded W 1 append special localized WeekFields element for numeric week-of-month d 1 appendValue(ChronoField.DAY_OF_MONTH) dd 2 appendValue(ChronoField.DAY_OF_MONTH, 2) D 1 appendValue(ChronoField.DAY_OF_YEAR) DD 2 appendValue(ChronoField.DAY_OF_YEAR, 2, 3, SignStyle.NOT_NEGATIVE) DDD 3 appendValue(ChronoField.DAY_OF_YEAR, 3) F 1 appendValue(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH) g..g 1..n appendValue(JulianFields.MODIFIED_JULIAN_DAY, n, 19, SignStyle.NORMAL) E 1 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT) EE 2 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT) EEE 3 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT) EEEE 4 appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL) EEEEE 5 appendText(ChronoField.DAY_OF_WEEK, TextStyle.NARROW) e 1 append special localized WeekFields element for numeric day-of-week ee 2 append special localized WeekFields element for numeric day-of-week, zero-padded eee 3 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT) eeee 4 appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL) eeeee 5 appendText(ChronoField.DAY_OF_WEEK, TextStyle.NARROW) c 1 append special localized WeekFields element for numeric day-of-week ccc 3 appendText(ChronoField.DAY_OF_WEEK, TextStyle.SHORT_STANDALONE) cccc 4 appendText(ChronoField.DAY_OF_WEEK, TextStyle.FULL_STANDALONE) ccccc 5 appendText(ChronoField.DAY_OF_WEEK, TextStyle.NARROW_STANDALONE) </pre> !(p) !(b)Time fields</b>: Pattern letters to output a time. !(pre) Pattern Count Equivalent builder methods
VV 2 appendZoneId() v 1 appendGenericZoneText(TextStyle.SHORT) vvvv 4 appendGenericZoneText(TextStyle.FULL) z 1 appendZoneText(TextStyle.SHORT) zz 2 appendZoneText(TextStyle.SHORT) zzz 3 appendZoneText(TextStyle.SHORT) zzzz 4 appendZoneText(TextStyle.FULL) </pre> !(p) !(b)Zone offset</b>: Pattern letters to output {@code ZoneOffset}. !(pre) Pattern Count Equivalent builder methods
[ 1 optionalStart() ] 1 optionalEnd() p..p 1..n padNext(n) </pre> !(p) Any sequence of letters not specified above, unrecognized letter or reserved character will throw an exception. Future versions may add to the set of patterns. It is recommended to use single quotes around all characters that you want to output directly to ensure that future changes do not break your application. !(p) Note that the pattern string is similar, but not identical, to {@link java.text.SimpleDateFormat SimpleDateFormat}. The pattern string is also similar, but not identical, to that defined by the Unicode Common Locale Data Repository (CLDR/LDML). Pattern letters 'X' and 'u' are aligned with Unicode CLDR/LDML. By contrast, {@code SimpleDateFormat} uses 'u' for the numeric day of week. Pattern letters 'y' and 'Y' parse years of two digits and more than 4 digits differently. Pattern letters 'n', 'A', 'N', and 'p' are added. Number types will reject large numbers.
@param pattern the pattern to add, not null @return this, for chaining, not null @throws IllegalArgumentException if the pattern is invalid