Skip to content

DF_DATABASE_DRIVER_DATE_FORMAT

Sets the driver date format for ODBC drivers that do not use the military date format (yyyy-mm-dd).

Level

Database

Supported by

DataFlex ODBC Driver, revision 5 and higher

Type

Enumerated Type, temporary

Access

Read/Write

Values

  • DF_DATE_USA
  • DF_DATE_EUROPEAN
  • DF_DATE_MILITARY

Syntax

Use cli.pkg
Get_Attribute DF_DATABASE_DRIVER_DATE_FORMAT of {driverNumber} {databaseHandle} to {IntegerVariable}
Set_Attribute DF_DATABASE_DRIVER_DATE_FORMAT of {driverNumber} {databaseHandle} ;
to {DF_DATE_USA|DF_DATE_EUROPEAN|DF_DATE_MILITARY}

Driver Configuration Keyword

Driver_Date_Format

Remarks

ODBC demands that drivers use the military format (yyyy-mm-dd) in the supported SQL. Nevertheless, there are drivers that do not use this format, but rather a format that depends on the country settings of the machine or the database client software. For those environments, the driver date format can be set.

Procedure ShowDBAttribute Integer iDriver Handle hDatabase
    Integer iAttribValue
    Get_Attribute DF_DATABASE_DRIVER_DATE_FORMAT of iDriver hDatabase to iAttribValue
    Showln "Date format: " iAttribValue ", " ;
        (If(iAttribValue = DF_DATE_MILITARY, "MILITARY", ;
        If(iAttribValue = DF_DATE_EUROPEAN, "EUROPEAN", "US")))
End_Procedure

The sample code above shows the current setting for a given database. The database handle can be obtained via the DF_DATABASE_ID attribute.