DF_DATE_SEPARATOR
See Also: DF_DECIMAL_SEPARATOR, DF_THOUSANDS_SEPARATOR
The decimal ASCII value of the character in use for separating the components of dates.
Level
Global
Supported by
All Drivers
Type
Numeric, temporary
Access
Read / Write
Values
0 - 255
Driver Configuration Keyword
None
Remarks
Dates, when presented as strings, are made up of three different parts (day, month, and year). The DF_DATE_SEPARATOR attribute indicates the separator in use. The order of the parts is defined by the DF_DATE_FORMAT attribute. The three parts are separated by a character (usually ‘/’ for US and European dates and ‘-‘ for Military dates).
By default, the DF_DATE_SEPARATOR will conform to the regional settings on the machine. Windows visual controls also use the regional settings. If the DF_DATE_SEPARATOR does not conform to the regional settings, errors will occur when using certain Windows controls. For this reason, you should only set this attribute on a temporary basis or in programs that have no user interface.
Temporarily changing the date format is often used to output dates in a required format. Some applications need to output information for additional processing by other, possibly third-party, applications. If the additional processing requires dates in a certain format, the DataFlex application should change the current date format to the required one, output the data, and reset the current date format to its original value. For a sample on temporarily changing the date separator, see DF_DATE_FORMAT.
Example
Procedure ShowFormats
Integer iDateFormat
String sDateFormat
Integer iDateSep
Integer iDecimalSep
Integer iThousandSep
Get_Attribute DF_DATE_FORMAT To iDateFormat
Get_Attribute DF_DATE_SEPARATOR To iDateSep
Get_Attribute DF_DECIMAL_SEPARATOR To iDecimalSep
Get_Attribute DF_THOUSANDS_SEPARATOR To iThousandSep
If (iDateFormat = DF_DATE_USA) Move "USA" To sDateFormat
Else If (iDateFormat = DF_DATE_EUROPEAN) Move "European" To sDateFormat
Else If (iDateFormat = DF_DATE_MILITARY) Move "Military" To sDateFormat
Else Move "Unknown" To sDateFormat
Send Info_Box ("Formats:\nDate:" * sDateFormat + ;
"\nDate separator:" * Character(iDateSep) + ;
"\nDecimal separator:" * Character(iDecimalSep) + ;
"\nThousand separator:" * Character(iThousandSep))
End_Procedure // ShowFormats
This example obtains the date and number format in use by DataFlex and then pops up a message box that displays a message showing which format is in use.