Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbStringToDateTime

Convert a date in string format into a packed CTDATETIME.

Declaration

CTDBRET ctdbStringToDateTime(pTEXT pStr, pCTDATETIME pDateTime,

CTDATE_TYPE DateType, CTTIME_TYPE TimeType)

Description

ctdbStringToDateTime() converts a date string to a packed CTDATETIME. The date is converted based on the DateType parameter, and the time is converted based on the TimeType parameter.

  • pStr [in] a pointer to the string with the date and time value.
  • pDateTime [out] Pointer to a CTDATETIME type value to received the converted string date and time
  • DateType [in] the date type. Valid types are listed c-treeDB API Data Types.
  • TimeType [in] the time type. Valid types are listed in c-treeDB API Data Types.

Returns

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

The possible errors associated with ctdbStringToDateTime() are:

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

See also

ctdbDateTimeToString(), ctdbStringToTime() (ctdbStringToTime, ctdbStringToTime), ctdbStringToDate()

TOCIndex