Trail: PROIV Documentation > Developer > PROIV Developer > Developing Functions > Events and Logic > CTIME
|
|
Purpose
|
CTIME converts between alphanumeric and numeric time.
|
Syntax
|
CTIME(operand)
|
Operation
|
operand is a valid alphanumeric constant, variable, or expression in the format HH:MM:SS, or a valid numeric constant, variable, or expression in the format 0.6.
|
Remarks
|
Two forms of time are supported by PROIV:
Alphanumeric - where the time is in the standard format HHMMSS (HH is the (24) hour, MM is the minutes, and SS is the seconds).
Numeric - where the time function is represented as a fraction of a day (e.g. 12:00 p.m. equates to .5). The advantage of this form is that numeric time can be combined with numeric format dates for arithmetic purposes.
The internal representation of a TIME field is "0.6", meaning there are no digits before the decimal point and six places after it.
CTIME also verifies that the alphanumeric time is legitimate (i.e. the hour cannot be greater than 23, and minutes and seconds cannot be greater than 59).
|
Example
|
Assume $TIME1 = ‘085624’ and #DATE1 = 67628
Format Result
#TIME2 = CTIME($TIME1).............gives....#TIME2 = 0.3725
#DATE2 = #DATE1 + #TIME2.......gives....#DATE2 = 67628.3725
#DATE3 = #DATE2 + 1.75............gives....#DATE3 = 67630.1225
$DATE4 = CDATE(INT(#DATE3))...gives....$DATE4 = ‘19850227’
$TIME4 = CTIME(FRAC(#DATE3))..gives....$TIME4 = ‘025624’
|
Comment on this topic
Topic ID: 520037