Skip to content

Formats

This section provides a list of date formatting patterns

PatternOutputDescription
yyyy0044, 0001, 1900, 2025Four-digit calendar year
yy44, 01, 00, 25Two-digit year calendar year
MM01, 02, ..., 12The month, 2-digits
M1, 2, ..., 12The month, beginning at 1
dd01, 02, ..., 31The day of the month, 2-digits
d1, 2, ..., 31The day of the month
hh01, 02, ..., 11, 12The hour, 12-hour clock, 2-digits
h1, 2, ..., 11, 12The hour, 12-hour clock
HH00, 01, 02, ..., 23The hour, 2-digits
H0, 1, 2, ..., 23The hour
mm00, 01, ..., 59The minute, 2-digits
m0, 1, ..., 59The minute
ss00, 01, ..., 59The second, 2-digits
s0, 1, ..., 59The second
SSS000, 001, ..., 999The millisecond, 3-digit
aAM, PMUpper case AM\PM
aaaam, pmLower case AM\PM