Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Date patternDescription
dDisplays the day as a number without a leading zero.
ddDisplays the day as a number with a leading zero when appropriate.
dayDisplays the day as a number written in words (“one” to “thirty one”).dayofweekDisplays the day as a full name (“Sunday” to “Saturday”).
MDisplays the month as a number without a leading zero.
MMDisplays the month as a number with a leading zero when appropriate
.monthDisplays the month as a full name (“January” to “December”).shortmonthDisplays the month as an abbreviation (“Jan to Dec”)
.
yyDisplays the year as a two-digit number.
yyyyDisplays the year as a four-digit number.
year
Displays the year as a number written in words (e.g. “two thousand and nine”)
hDisplays the hour as a number without a leading zero, based on the 12-hour clock.
HHDisplays the hour as a number with a leading zero, based on the 24-hour clock.
hhDisplays the hour as a number with a leading zero, based on the 12-hour clock.
mmDisplays the minute as a number with a leading zero.
ssDisplays the second as a number with a leading zero.
SDisplays the decisecond
SSDisplays the centisecond
SSSDisplays the millisecond
aDisplays 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:

...


CharacterDescription
-Hyphen
,Comma
.Period
;Semicolon
:Colon
 

Space
/Forward slash
TTime separator
Space