ifx_defmtdate()

Converts a string in a specified format to the native database date format.

Syntax

mint ifx_defmtdate(int4 *pdate, char *fmt, char *input, char c);
  1. pdate is a pointer to an int4 integer value that receives the internal DATE value for the input string.
  2. fmt points to a string containing the formatting mask.
  3. input is a pointer to the buffer that contains the date string to convert.
  4. c is a character that determines which century to apply to the year portion of the date.

Returns

Table 1. Return codes
Code Description
0 The conversion was successful.
<0 The conversion failed.
-1204 The str parameter specifies an invalid year.
-1205 The str parameter specifies an invalid month.
-1206 The str parameter specifies an invalid day.
-1212 Data conversion format must contain a month, day, or year component. DBDATE specifies the data conversion format.
-1209 Because *input does not contain delimiters between the year, month, and day, the length of *input must be exactly six or eight bytes.

Usage

The fmt string contains the formatting mask for the string.

The function allows you to specify the century setting for two-digit dates. The c parameter must be one of century characters, which determines which century to apply to the year portion of the date.