Date pattern | Description |
---|
d | Displays the day as a number without a leading zero. |
dd | Displays the day as a number with a leading zero when appropriate. |
day | Displays the day as a number written in words (“one” to “thirty one”). |
dayofweek | Displays the day as a full name (“Sunday” to “Saturday”). |
M | Displays the month as a number without a leading zero. |
MM | Displays the month as a number with a leading zero when appropriate |
.month | Displays the month as a full name (“January” to “December”). |
shortmonth | Displays the month as an abbreviation (“Jan to Dec”). |
yy | Displays the year as a two-digit number. |
yyyy | Displays the year as a four-digit number. |
yearDisplays the year as a number written in words (e.g. “two thousand and nine”) | h | Displays the hour as a number without a leading zero, based on the 12-hour clock. |
HH | Displays the hour as a number with a leading zero, based on the 24-hour clock. |
hh | Displays the hour as a number with a leading zero, based on the 12-hour clock. |
mm | Displays the minute as a number with a leading zero. |
ss | Displays the second as a number with a leading zero. |
S | Displays the decisecond |
SS | Displays the centisecond |
SSS | Displays the millisecond |
a | Displays AM for times from midnight until noon and PM for times from noon until midnight. |
The following characters are allowed to be used as separators in a date pattern:
...
Character | Description |
---|
- | Hyphen |
, | Comma |
. | Period |
; | Semicolon |
: | Colon |
| |
| Space |
/ | Forward slash |
T | Time separator |
Space