Date and Time Formatting

Common Date and Time Symbols

SymbolMeaningPatternExample Output
yyearyy
y or yyyy
96
1996
Mmonth in yearM
MM
MMM
MMMM
MMMMM
9
09
Sep
September
S
wweek of yearw
ww
27
27
dday in monthd
dd
2
02
Eday of weekE, EE, or EEE
EEEE
EEEEE
EEEEEE
Tue
Tuesday
T
Tu
elocal day of week (example: if Monday is 1st day, Tuesday is 2nd)e
ee
eee
eeee
eeeee
eeeeee
2
02
Tue
Tuesday
T
Tu
aAM or PMa, aa, or aaa
aaaa
aaaaa
PM [abbrev]
PM [wide]
p
hhour in am/pm (1–12)h
hh
7
07
Hhour in day (0–23)H
HH
0
00
mminute in hourm
mm
4
04
ssecond in minutes
ss
5
05
zTime Zone: specific non-locationz, zz, or zzz
zzzz
PDT
Pacific Daylight Time
ZTime Zone: ISO8601 basic hms? / RFC 822
Time Zone: long localized GMT (=OOOO)
Time Zone: ISO8601 extended hms? (-XXXXX)
Z, ZZ, or ZZZ
ZZZZ
ZZZZZ
-0800
GMT-08:00
08:00, -07:52:58, Z
OTime Zone: short localized GMT
Time Zone: long localized GMT (=ZZZZ)
O
OOOO
GMT-8
GMT-08:00
vTime Zone: generic non-location (falls back first to VVVV)v
vvvv
PT
Pacific Time or Los Angeles Time
VTime Zone: short time zone ID
Time Zone: long time zone ID
Time Zone: time zone exemplar city
Time Zone: generic location (falls back to OOOO)
V
VV
VVV
VVVV
uslax
America/Los_Angeles
Los Angeles
Los Angeles Time

Advanced Date and Time Symbols

See advanced date and time symbols here.