The Java SimpleDateFormat class can represent many date formats including SSSXXX. Each letter in the date can signify date, time, timezone or some other things.

SSSXXX represents milliseconds and timezone.

  • SSS – 3 digit milliseconds.
  • XXX – Timezone in hour:minute format with appropriate signs (+/-)

// It could be 2001-07-04T12:08:56.235-07:00

In our code example SSS = 235 and XXX = -07:00

Check out the list of all the date and time patterns –

LetterDate or Time ComponentPresentationExamples
GEra designatorTextAD
yYearYear1996;Β 96
YWeek yearYear2009;Β 09
MMonth in yearMonthJuly;Β Jul;Β 07
wWeek in yearNumber27
WWeek in monthNumber2
DDay in yearNumber189
dDay in monthNumber10
FDay of week in monthNumber2
EDay name in weekTextTuesday;Β Tue
uDay number of week (1 = Monday, …, 7 = Sunday)Number1
aAm/pm markerTextPM
HHour in day (0-23)Number0
kHour in day (1-24)Number24
KHour in am/pm (0-11)Number0
hHour in am/pm (1-12)Number12
mMinute in hourNumber30
sSecond in minuteNumber55
zTime zoneGeneral time zonePacific Standard Time;Β PST;Β GMT-08:00
ZTime zoneRFC 822 time zone-0800
XTime zoneISO 8601 time zone-08;Β -0800;Β -08:00

Β Β Β Β Tweet this to help others

Tagged in:



About the Author


I am Akash Mittal, an overall computer scientist. If you want to guest post, need help in your projects, want to advertise, Feel free to contact me at [email protected]

View All Articles