Symbol | Description | Example |
yy | Short year | 08 |
yyyy | Long year | 2008 |
MM | Month as a number | 07 |
MMM | Short month name | Jul |
MMMM | Full month name | July |
d | Day in month | 10 |
W | Week in month | 2 |
w | Week in year | 28 |
DD | Day in year | 192 |
E | Short day of week | Thu |
EEEE | Long day of week | Thursday |
H | Hour in day (0 ‑ 23) | 0 |
k | Hour in day (1 ‑ 24) | 24 |
K | Hour in AM/PM (0 ‑ 11) | 0 |
h | Hour in AM/PM (1 ‑ 12) | 12 |
a | AM/PM | 12:00:00AM |
mm | Minutes | 30 |
ss | Seconds | 55 |
Format pattern | Result of formatting |
MM‑dd‑yy | 04‑15‑06 |
E, M/d/yyyy | Fri, 4/15/2006 |
MMM d | Apr 15 |
MMMM | April |
yyyy | 2006 |
W | 3 (the week in the month) |
w | 15 (the week in the year) |
DD | 105 (the day in the year) |
h:mm:ss | 12:15:30 |