13.3.2 Date Values

As with boolean values, string comparisons are made case insensitive. String comparisons are done for days of the week (both full names and abbreviated names), and month names (full and abbreviated). With dates, partial matches are not considered valid. Names must be entered fully; if the month is June, june must be entered (with any variation in case).

When a date input string does not match the format, two forms of input are recognized: dd-mmm-yy[yy] or nn-nn-nn[nn]. In either form, the minus sign (-) can be any punctuation character or nothing at all.

The first form is called a European form. If, after processing two digits and an optional separator character, a letter is found, this form is assumed and processed as such. The month (mmm) is a three letter abbreviation of the name of the month (case insensitive). The year (yy[yy]) can be two or four digits. Four digits are required only when the century is something other than 1900.

The second form recognized by the standard rules is just a common shorthand notation of dates. However, different countries use a different order for the numbers of month, day, and year. Most European countries use d/m/y, while U.S.A. uses m/d/y. To handle this, the order of numbers is controlled by the input date order parameter of the format set (see "Country Defaults" section).

In processing the shorthand form, first two digits are scanned. If something other than a digit is next, it is used as the separator character. Then two more digits are scanned and, optionally, another separator (if and only if there was one after the first two digits). Lastly, the remaining two or four digits are processed. Based on the date order parameter, the groups of digits are checked for validity and converted into a data value.