Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbDateToString

Convert a packed CTDATE into a string.

Declaration

CTDBRET ctdbDateToString(CTDATE date, CTDATE_TYPE DateType,

pTEXT pStr, VRLEN size)

Description

ctdbDateToString() converts a packed CTDATE into a string. The date is converted to string based on the DateType parameter. To convert a packed CTTIME to string, use ctdbTimeToString(). Use ctdbStringToDate() to convert from a string to CTDATE.

  • date [in] the date, in CTDATE format.
  • DateType [in] the date type. Valid types are listed in c-treeDB API Data Types.
  • pStr [in] the pointer to the string that will result from the conversion.
  • size [in] the buffer size of the string.

Returns

ctdbDateToString() returns CTDBRET_OK on success, or c-treeDB API error on failure.

The possible errors associated with ctdbDateToString() are:

  • CTDBRET_NULARG (4007): Null argument not valid in pStr
  • CTDBRET_INVDATE (4029): Invalid format in DateType
  • CTDBRET_INVTYPE (4019): Invalid type in DateType
  • CTDBRET_ARGSMALL (4006): Buffer is too small (increase size)

See also

ctdbStringToDate(), ctdbTimeToString(), ctdbDateTimeToString()

TOCIndex