rdefmtdate()

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

Syntax

mint rdefmtdate(int4 *pdate, char *fmt, char *input);
  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 string to convert.

Returns

Table 1. Return codes
Code Description
0 The operation was successful.
-1204 The input parameter specifies an invalid year.
-1205 The input parameter specifies an invalid month.
-1206 The input parameter specifies an invalid day.
-1209 Because input does not contain delimiters between the year,month,and day, the length ofinput must be exactly six or eight bytes.
-1212 fmt does not specify a year, a month, and a day.

Usage

The fmt string contains the formatting mask for the string.