dtcvfmtasc()

Converts a character string to a datetime value, specifying the format of the string.

Syntax

mint dtcvfmtasc(char *input, char *fmt, dtime_t *d);
  1. input is a pointer to a buffer that contains the string to convert.
  2. fmt points to the formatting mask.
  3. d is a pointer to the datetime variable, which must be initialized with the desired qualifier.

Returns

Table 1. Return codes
Code Description
0 The conversion was successful.
<0 The conversion failed.

Usage

The fmt parameter defines the formatting mask. The default datetime format conforms to the standard ANSI SQL format: %Y-%m-%d %H:%M:%S