DateDelim option

Specifies the delimiter character that separates the date components that are used with the DateStyle option.

The default is a dash ('-') for all DateStyle option values except MONDY and MONDY2, for which the default is a space (' '). The value of the option is a single-byte string.

The following rules apply:
  • If you specify the option as an empty string, which means that there is no delimiter between the date components, you must specify days and months as two-digit numbers. Single-digit days and months are not supported.
  • With days and months less than 10, use one or two digits, or use a space that is followed by a single digit.
  • If the value of the DateDelim option is a space, the system allows a comma after the day.
  • If any component (day, month, year) is zero or there is any day and month inconsistency, such as August 32 or February 30, the system returns an error.
The following table lists DateDelim option examples.
Table 1. DateDelim option examples
No DateDelim value DateDelim value is comma (',') DateDelim value is space (' ')
Jan 01 2003 Jan 01,2003 Jan 01, 2003
Jan 1 2003 Jan 1,2003 Jan 1, 2003
Jan 1 2003 Jan 1,2003 Jan 1, 2003

If you do not use delimiters, the date is determined as in the following example for June 12, 2009: 06122009.