What are the defaults for the DATE-ENTRY control DISPLAY-FORMAT property and format styles?

Question ID : 50
Created on 2009-08-31 at 5:44 PM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=50



Question:

It seems that the default value for the DATE-ENTRY control DISPLAY-FORMAT property and the formats used by the CENTURY-DATE, LONG-DATE, SHORT-DATE and TIME styles are different from those used by ACUCOBOL-GT. What are the formats? How do I get the same behavior as ACUCOBOL-GT?

Answer:

The display formats used by isCOBOL for the DATE-ENTRY control are as follows:

The TIME style is equivalent to DISPLAY-FORMAT "HH:mm:ss"
The CENTURY-DATE style is equivalent to DISPLAY-FORMAT "dd/MM/yyyy"
The LONG-DATE style is equivalent to DISPLAY-FORMAT "EEEE dd MMMM yyyy"

If no display format styles or properties are specified then DISPLAY-FORMAT "dd/MM/yyyy"is used as the default.

In the United States a common date format is DISPLAY-FORMAT "M/d/yyyy"

With ACUCOBOL-GT the exact format depends on settings specified by the user in the Windows Control Panel. To get the same behavior as ACUCOBOL-GT with the most common system settings in the United States, use the following formats:

Instead of the TIME style, use DISPLAY-FORMAT "h:mm a"
Instead of the CENTURY-DATE style, use DISPLAY-FORMAT "MM/dd/yyyy"
Instead of the LONG-DATE style, use DISPLAY-FORMAT "EEEE, MMMM dd, yyyy"

If your code does not currently specify any of the above styles and does not specify the DISPLAY-FORMAT property, use DISPLAY-FORMAT "M/d/yyyy".

You can also use properties to specify these formats, and to facilitate transitions from ACUCOBOL-GT, the isCOBOL ISCONFIG utility adds the following properties when translating configuration files:

iscobol.gui.date_entry.time="h:mm a"
iscobol.gui.date_entry.century_date="MM/dd/yyyy"
iscobol.gui.date_entry.long_date="EEEE, MMMM dd, yyyy"
iscobol.gui.date_entry.display_format="M/d/yyyy"




Back to Original Question