What are the defaults for the DATE-ENTRY control DISPLAY-FORMAT property and format styles?
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"
Article ID: 50
Created: August 31, 2009
Last Updated: August 31, 2009
Author: Support KB Author
Online URL: https://support.veryant.com/phpkb/article.php?id=50