... leading zeros (e.g., 04).
j Display the day of the year with three digits, padding with leading zeros as necessary (e.g., 016).

Fig. I.8 Time formatting conversion suffix characters.

Conversion suffix character Description
H Display hour in 24-hour clock with a leading zero as necessary (e.g., 16).
I Display hour in 12-hour clock with a leading zero as necessary (e.g., 04).
k Display hour in 24-hour clock without leading zeros (e.g., 16).
l Display hour in 12-hour clock without leading zeros (e.g., 4).
M Display minute with a leading zero as necessary (e.g., 06).
S Display second with a leading zero as necessary (e.g., 05).
Z Display the abbreviation for the time zone (e.g., EST, stands for Eastern Standard Time, which is 5 hours ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.