CTOT()

Advantage Concepts

Advantage Expression Engine function that returns a Time value from a character expression.

Syntax

CTOT(<cTime>)

Parameters

<cTime>

A character string consisting of numbers representing the hour, minutes, seconds, and milliseconds separated by : characters (or any non-numeric character). The hours can be from 0-23, or from 1-12 with an "am" or "pm" specified in <cTime>. If the hour is from 1-11 with no "am" or "pm" specified in <cTime>, the time returned is am. If the hour is 12 and no "am" or "pm" indicator is specified, it is assumed to be 12pm.

Return Value

CTOT() returns a time value. If <cTime> is not a valid time, CTOT() returns an empty time (0).

Remarks

CTOT() is a character conversion function that converts a character string to a time. CTOT() is used whenever you need a literal time value. Some examples include:

Note Advantage Expression Engine functions can be used in expressions such as record filter expressions and index expressions. They are not necessarily scalars supported within SQL statements. For a list of supported SQL scalar functions, see Supported Scalar Functions.

Note Memo, binary, and image fields are not supported in this Advantage Expression Engine function. If memo, binary, or image fields are used with this expression engine function, the Advantage Expression Engine will be unable to evaluate the expression.

Examples

CTOT( "" )    // returns an empty time

CTOT( "12:00:00am" )  // midnight - 12:00 am

CTOT( "12:00:00" )  // noon - 12:00 pm

CTOT( "1:21:12pm" ) // 1:21:12 pm

CTOT( "21:12" )   // 9:21 pm

CTOT( "2:00" )  // 2:00 am

CTOT( "1:25:15.234") // 234 milliseconds after 1:25:15 am

See Also

CTOTS()

CTOD()

STOD()

STOTS()

Advantage TDataSet Descendant

AdsGetTime

AdsGetMilliseconds

Advantage Client Engine API

AdsGetTime

AdsGetMilliseconds