Documentation Center

Format specifiers for Dates and Times

This a list of the symbols you can use to define the format for Dates and Times.

Date specifiers

  • d - Day of month, 1-31
  • dd - Day of month, 01-31
  • M - Month, 1-12
  • MM - Month, 01-12
  • MMM - Abbreviated month name, Jan.
  • MMMM - Full month name, January
  • yy - Year, 0-99
  • yyy - Year, 00-99
  • yyyy - Year, 4 digit
  • ddd - Abbreviated day name, Mon.
  • dddd - Full day name, Monday
  • gg - Era information, for example A.D. or B.C

Time specifiers

  • h - Hour, 1-12
  • hh - Hour, 01-12
  • H - Hour, 0-23
  • HH - Hour, 00-23
  • m - Minute, 0-59
  • mm - Minute, 00-59
  • s - Seconds, 0-59
  • ss - Seconds, 00-59
  • t - The first character of the AM/PM designator
  • tt - The entire AM/PM designator
  • K - Time zone information, + hh:mm