Focal Point
[CLOSED] Getting a elapsed time serial number into a specific time format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8937090526

October 12, 2012, 03:10 PM
Denny99
[CLOSED] Getting a elapsed time serial number into a specific time format
I'm working with Dev Studio 7.7.03. I unable to find any documentation on converting a elapsed time field (serial number) in a format like HH:MM:SS. Also, the "HH" fields can be larger than 24 hours. In Excel you have a customized format [h]:mm:ss which does exactly what I need to do but I can't find anything in WebFocus to do such converstion. Please Help!

This message has been edited. Last edited by: Kerry,
October 12, 2012, 08:44 PM
Dan Satchell
Here are some ideas. This code example assumes your elapsed time is in seconds. Dividing the elapsed time by 86400 will give the number of complete elapsed days with function INT. Then using functions HINPUT and HADD in a technique posted earlier by Waz here, the remaining elapsed time can be calculated and presented in hh:mm:ss format. The number of elapsed days does not need to be subtracted from the total elapsed time before calculating the remaining elapsed time because use of format HHIS essentially ignores the passing days. For example, each time 86400 is added to the value of variable &ELPASED in the code below, ELAPSED_DAYS increments by 1, but ELAPSED_TIME does not change in the output.

-SET &ELAPSED = 86398 ;
-*
DEFINE FILE CAR
 ELAPSED_DAYS/I5 WITH COUNTRY = INT(&ELAPSED / 86400);
 NULL_TIME/HHIS WITH COUNTRY  = HINPUT(1,'0',8,'HHIS');
 ELAPSED_TIME/HHIS            = HADD(NULL_TIME,'SECOND',&ELAPSED,8,'HHIS');
END
-*
TABLE FILE CAR
 PRINT ELAPSED_DAYS ELAPSED_TIME
 WHERE RECORDLIMIT EQ 1 ;
END

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05