DB2 10.5 for Linux, UNIX, and Windows

DateTimeStringFormat CLI/ODBC configuration keyword

Specifies the format to use when you insert date or time data into character columns.

db2cli.ini keyword syntax:
DateTimeStringFormat = JIS | ISO | EUR | USA
Default setting:
The JIS format is used when date or time data is inserted into character columns.
Usage notes:
 
The DateTimeStringFormat keyword affects the insertion of SQL_C_TYPE_DATE, SQL_C_TYPE_TIME, or SQL_C_TYPE_TIMESTAMP, or SQL_C_TIMESTAMP_EXT data into the following column types:
  • SQL_CHAR
  • SQL_VARCHAR
  • SQL_LONGVARCHAR
  • SQL_CLOB

The DateTimeStringFormat keyword also affects the format of date or time columns that are retrieved into character strings. For example, retrieving data from an SQL_TYPE_TIMESTAMP column into an SQL_C_CHAR string is affected by the DateTimeStringFormat keyword setting.

The DateTimeStringFormat keyword value is ignored if you set all of the following attributes with the SQLSetEnvAttr() function or the SQLSetConnectAttr() function:
  • SQL_ATTR_DATE_FMT
  • SQL_ATTR_TIME_FMT

If you set only the SQL_ATTR_DATE_FMT attribute but not the SQL_ATTR_TIME_FMT attribute, the DateTimeStringFormat keyword value takes effect for the time data type.

If you set only the SQL_ATTR_TIME_FMT attribute but not the SQL_ATTR_DATE_FMT attribute, the DateTimeStringFormat keyword value takes effect for the date data type.

Table 1. Setting Values
Format Date Time Timestamp
JIS yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss.ffffffffffff
ISO yyyy-mm-dd hh.mm.ss yyyy-mm-dd-hh.mm.ss.ffffffffffff
EUR dd.mm.yyyy hh.mm.ss yyyy-mm-dd hh:mm:ss.ffffffffffff*
USA mm/dd/yyyy hh:mm AM or PM yyyy-mm-dd hh:mm:ss.ffffffffffff*
*Timestamps takes the default format if EUR or USA is specified. The default format is JIS.