INTEGER_OF_TIME

The INTEGER_OF_TIME function converts a time in the form (HHMMSShh) to 100th-of-a-second form. The type of this function is integer.

The functionality is identical to the COBOL85 function INTEGER-OF-TIME.

Explanation

The one parameter to this function must be an integer in the form HHMMSShh, whose value is obtained from the calculation (HH * 1000000) + (MM * 10000) + (SS * 100) + hh.

In the representation YYYYMMDD, . . .

Represents . . .

HH

Represents the hour in 24-hour format. It must be in the range 0 through 23.

MM

Represents the minute. It must be in the range 0 through 59.

SS

Represents the second. It must be in the range 0 through 59.

hh

Represents the 100ths of a second.

An invalid argument will return a value of 0 (zero).

The returned value is an integer that is the number of 100th-of-a-seconds into the day represented by the integer parameter.

Example

BEGIN
  $ INCLUDE INTL = "*SYMBOL/INTL/ALGOL/PROPERTIES." 10000000 - 89999999
  EBCDIC ARRAY OUT[0:100];
  EBCDIC ARRAY A[0:20];
  POINTER P;
  INTEGER HHMMSShh;
  INTEGER IOT, TOI;
  P := OUT[0];
  CURRENT_DATE(A);
  HHMMSShh := INTEGER(A[8],8);
  IOT := INTEGER_OF_TIME(HHMMSShh);
  REPLACE P BY "HHMMSShh=", HHMMSShh FOR 8 DIGITS,
                         " INTEGER_OF_TIME=", IOT FOR 7 DIGITS, 0 FOR 1;
  DISPLAY(P);
END.             

If run at 3:16 PM the program would display:

            HHMMSShh=15163549 INTEGER_OF_TIME=5499549