Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbStringToTime

Convert a time in string format to CTTIME packed format with whole second precision.

NOTE: See ctdbStringToTimeMsec() if you need millisecond precision.

Declaration

CTDBRET ctdbStringToTime(pTEXT pStr, CTTIME_TYPE TimeType,

pCTTIME pTime)

Description

ctdbStringToTime() converts a time in string format to CTTIME packed format. Use ctdbTimeToString() to convert a packed CTTIME into a string.

  • pStr [in] the pointer to the string.
  • TimeType [in] the time types. Valid types described in FairCom DB API Data Types.
  • pTime [out] the pointer to a CTTIME value that will result from the conversion.

Returns

ctdbStringToTime() returns CTDBRET_OK on success, or FairCom DB API C error on failure.

The possible errors associated with ctdbStringToTime() are:

  • CTDBRET_NULARG (4007): Null argument not valid in pStr
  • CTDBRET_NOMEMORY (4001): Not enough memory
  • CTDBRET_INVFORMAT (4028): Invalid format in TimeType
  • CTDBRET_INVTIME (4033): Invalid packed CTTIME

See also

ctdbTimeToString(), ctdbStringToTimeMsec(), ctdbTimeMsecToString()

TOCIndex