Specifies the format to use when you insert date or time data into character columns.
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.
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.
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. |