dttofmtasc()

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

Syntax

mint dttofmtasc(dtime_t *d, char *output, mint len, char *fmt);
  1. d is a pointer to the initialized datetime variable to convert.
  2. output is a pointer to the buffer that receives the string for the value in d.
  3. fmt points to the formatting string.
  4. len is the length of the output buffer.

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