DBDATE

Defines the default display and input format for DATE values.

Usage

The DBDATE environment variable defines the default display and input format for DATE values.

DBDATE defines the order of the month, day, and year time units within a date, whether the year is printed with two digits (Y2), three (Y3+C1) or four digits (Y4) and the time-unit separator between the month, day, and year.

Values can be a restricted combination of several symbols.

Table 1. Valid DBDATE symbols
Symbol Meaning in DBDATE format string
D Day of month as one or two digits
M Month as one or two digits
Y2 Year as two digits
Y3 Year as three digits (Ming Guo format only)
Y4 Year as four digits
/ Default time-unit separator for the default locale
C1 Ming Guo format modifier (years as digits)
- Minus time-unit separator
, Coma time-unit separator
. Period time-unit separator
0 Indicates no time-unit separator

The combinations must follow a specific order:

  { DM | MD } { Y2 | Y3 | Y4 } { / | - | , | . | 0 } [C1]
  { Y2 | Y3 | Y4 } { DM | MD } { / | - | , | . | 0 } [C1]

The default setting for DBDATE is: MDY4/

When a form field and its corresponding variable are defined with the DATE type, values will be displayed according to the DBDATE format, except if a FORMAT attribute is defined.

The DBDATE format is also used to automatically convert a character string to/from a DATE value in programs.

Note that DBDATE takes also effect when fetching DATE values from the database into CHAR/VARCHAR program variables. However, it is not recommended to fetch date information into string variables, you should use DATE or DATETIME variables instead.

The C1 modifier can be used at the end of the DBDATE value in order to use Ming Guo date format with digit-based years. When using C1, you can use one of the Y4, Y3 or Y2 symbols for the year.

Date formatting specified in a USING clause or FORMAT attribute overrides the formatting specified in DBDATE.

Gregorian date format:
DBDATE="DMY4/"
export DBDATE
Ming Guo date format:
DBDATE="Y3MD/C1"
export DBDATE