Java Reference
In-Depth Information
Table 12-6. ( continued )
Symbol
Description
Examples
F
F
1
Day of week in month
a
a
AM
AM/PM of day
h
h
7
Clock hour of AM/PM (1-12)
K
K
7
Hour of AM/PM (0-11)
k
k
7
Clock hour of AM/PM (1-24)
H
H
7
Hour of day (0-23)
HH
07
m
mm
30
Minute of hour
s
ss
12
Second of minute
S
SSSSSSSSS
000000789
Fraction of second
A
A
27012000
Millisecond of day
n
n
789
Nanosecond of second
N
N
27012000000789
Nanosecond of day
V
VV
America/Chicago
Time zone ID
z
z
CDT
Time zone name
Z
Z
-0500
Zone offset
When the zone offset is zero, it outputs '+0000' or '+00:00'
depending on whether you use Z, ZZ, or ZZZ.
ZZ
-0500
ZZZ
-05:00
ZZZZ
GMT-05:00
O
O
GMT-5
Localized zone offset
X
XXX
-05:00
Zone offset
Unlike the symbol 'Z, it prints Z for the zone offset Zero.
X outputs only the hour such as '+09'; XX outputs the
hour and minute, without a colon such as '+0830'; XXX
outputs the hour and minute with a colon such as '+08:30';
XXXX outputs the hour, minute, and optional second,
without a colon such as '+083045'; and, XXXXX outputs
the hour, minute, and option second, with a colon such as
'+08:30:45.
x
xx
-0500
Same as X, except that it prints '+00' for the zone offset
zero, not 'Z.
p
pppmm
' 30'
(Single quotes
have been shown to
display the padding
with a space.)
Pad next
It pads the output of the pattern following it with spaces.
For example, if mm outputs 30, pppmm will output
' 30' and ppppmm will output ' 30. The number of p
determines the width of the output.
( continued )
 
Search WWH ::




Custom Search