Advantage Concepts
Advantage Expression Engine function that returns a Time value from a character expression.
CTOT(<cTime>)
<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. |
CTOT() returns a time value. If <cTime> is not a valid time, CTOT() returns an empty time (0).
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:
Comparing the result of a time expression to a literal time string.
Defining a filter that compares a literal time string with a timestamp or time field. For example, if a table has a time field named ‘time’, then the filter "CtoT( ’10:30am’) > time" could be used to find all records where the time field has a value earlier than 10:30am. If CTOT() is used to compare a value with a timestamp field, then only the time portion of the field is used in the comparison; the date portion is ignored.
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.
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
AdsGetTime
AdsGetMilliseconds
AdsGetTime
AdsGetMilliseconds