Date and Time Format Strings

Date Format

The format string for date can contain following items:
DD - day, integer between 01 and 31
MM - month, integer between 01 and 12
MON - upper case month name, the string between 'JAN' and 'DEC'
mon - lower case month name, the string between 'jan' and 'dec'
YY - two-digits year, integer between 00 and 99.
YYYY - four-digits year, integer.
C - century, integer 0 to 8 value: 0 means 19xx, 1 means 20xx, etc. It is not compatible with YYYY.

Default date format depends on local user's settings.

Time Format

The format string for time can contain following items:
HH - hour, an integer between 00 and 23 (or 01 to 12).
mm - minute, an integer between 00 and 59. MM is also acceptable but not recommended.
SS - second, an integer between 00 and 59.
sss - milliseconds, integer between 000 and 999.
AM - AM or PM sign.
zz - time zone between -11:00 and +11:00.

Default time format depends on local user's settings.

Limitation: comma can't be used as a separator.

Notes

  • All mentioned format items are case sensitive. For example, you can't use 'yyyy' instead of 'YYYY'.
  • All digits mentioned in the format are mandatory. I.e. '1' can't be used for 'DD' format instead of '01'.