Date and Time Formatting

Common Date and Time Symbols

Symbol

Meaning

Pattern

Example Output

y

year

yy
y or yyyy

96
1996

M

month in year

M
MM
MMM
MMMM
MMMMM

9
09
Sep
September
S

w

week of year

w
ww

27
27

d

day in month

d
dd

2
02

E

day of week

E, EE, or EEE
EEEE
EEEEE
EEEEEE

Tue
Tuesday
T
Tu

e

local day of week (example: if Monday is 1st day, Tuesday is 2nd)

e
ee
eee
eeee
eeeee
eeeeee

2
02
Tue
Tuesday
T
Tu

a

AM or PM

a, aa, or aaa
aaaa
aaaaa

PM [abbrev]
PM [wide]
p

h

hour in am/pm (1–12)

h
hh

7
07

H

hour in day (0–23)

H
HH

0
00

m

minute in hour

m
mm

4
04

s

second in minute

s
ss

5
05

z

Time Zone: specific non-location

z, zz, or zzz
zzzz

PDT
Pacific Daylight Time

Z

Time 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

O

Time Zone: short localized GMT
Time Zone: long localized GMT (=ZZZZ)

O
OOOO

GMT-8
GMT-08:00

v

Time Zone: generic non-location (falls back first to VVVV)

v
vvvv

PT
Pacific Time or Los Angeles Time

V

Time 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.