Convert an integer component of a DBDATETIME value into character format.
RETCODE dbdatechar(dbproc, charbuf, datepart, value) DBPROCESS *dbproc; char *charbuf; int datepart; int value;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
A pointer to the character buffer that will contain the null-terminated character representation of value.
A symbolic constant describing value’s type. Table 2-14 lists the date parts, the date part symbols recognized by DB-Library, and the expected values. Note that the names of the months and the days in this table are those for English.
Date part |
Symbol |
Character representation of value |
---|---|---|
year |
DBDATE_YY |
1753 – 9999 |
quarter |
DBDATE_QQ |
1 – 4 |
month |
DBDATE_MM |
January – December |
day of year |
DBDATE_DY |
1 – 366 |
day |
DBDATE_DD |
1 – 31 |
week |
DBDATE_WK |
1 – 54 (for leap years) |
weekday |
DBDATE_DW |
Monday – Sunday |
hour |
DBDATE_HH |
0 – 23 |
minute |
DBDATE_MI |
0 – 59 |
second |
DBDATE_SS |
0 – 59 |
millisecond |
DBDATE_MS |
0 – 999 |
The numeric value to be converted.
SUCCEED or FAIL.
dbdatechar converts integer datetime components to character format. For example, dbdatechar associates the month component “3” with its associated character string: “March” if English is used, “mars” if French is used, and so on.
The language of the associated character string is determined by the dbproc.
dbdatechar is often useful in conjunction with dbdatecrack.