dttoasc()

Converts a datetime value to an ANSI-standard character string.

Syntax

mint dttoasc(dtime_t *d, char *str);
  1. d is a pointer to the initialized datetime variable to convert.
  2. str is a pointer to the buffer that receives the ANSI-standard datetime string for the value in d .

Returns

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

Usage

The str parameter includes one character for each delimiter, plus the fields, which are of the following sizes:
Table 2. Datetime field sizes
Field Field Size
year four digits
fraction of datetime as specified by precision
all other fields two digits
For example, datetime year to fraction(5):
YYYY-MM-DD HH:MM:SS.FFFFF