Using the Ming Guo date format

Genero BDL can be configured to use the The Ming Guo calendar.

The Ming Guo (or Minguo) calendar is still used in some Asian regions like Taiwan. This calendar is equivalent to the Gregorian calendar, except that the years are numbered with a different base. In the Ming Guo calendar, the first year (1) corresponds to the Gregorian year 1912, the year the Republic of China was founded.

Digit-based year Ming Guo date format can be enabled by adding the C1 modifier at the end of the value set for the DBDATE environment variable:
$ DBDATE="Y3MD/C1"
$ export DBDATE

With this DBDATE setting, dates will be displayed with a year following the Ming Guo calendar, and date input will also be interpreted based on that calendar. For example, if the user enters 90/3/24, it is equivalent to an input of 2002/3/24 when using the Gregorian calendar. Basically, the runtime system will subtract 1912 or add 1912 respectively when displaying or reading date values).

When using the C1 modifier, the possible values for the Yn symbol are Y4, Y3, Y2.

The MDY() operator is sensitive to the C1 modifier usage in DBDATE. For example, if DBDATE=Y3MD/C1, MDY(3,24,1) will build a date the corresponds in the Gregorian to MDY(3,24,1912).

The USING operator supports the c1 modifier as well. The c1 modifier must be specified at the end of the format. You can for example use the following format string: "yyyy-mm-ddc1".

The C2 modifier to use Era names is not supported.

Unlike Informix® 4gl, when using negative years, the minus sign is placed over the left-most zero of the year, to avoid miss-aligned dates.

For example, if DBDATE=Y3MD/C1:
MDY(3,2, 1) USING "yyy/mm/ddc1" 
MDY(3,2,-1) USING "yyy/mm/ddc1"
Will align properly as follows:
0001/03/02
-001/03/02
Note: Front-ends may not support the Ming Guo calendar for widgets like DATEEDIT.