Page 1 of 1

Elapsed Time Calculation

PostPosted: Wed Sep 30, 2009 9:53 pm
by qz2s4m
Has anyone coded Easytrieve or is there a funtion available that will assist in generating elapsed time from SMF time stamps?

Need to take in the fields like Readtime and Print End Time and calculate the difference in hours, possibly days. Definitely seems challenging when entries can span days between.

Any assistance is appreciated.

Duane

Re: Elapsed Time Calculation

PostPosted: Wed Sep 30, 2009 11:50 pm
by dick scherrer
Hello,

I know of no builtin Easytrieve function to work with SMF format data.

To do what you want, suggest the code first determine if the elapsed time is greater than one day. If it is, calculate the number of full days elapsed. Then use the remainder of the time (even if it spans days, it will be less than 24 hours once the complete days have been removed from the equation) to calculate hh.mm.ss.hh. . .

Re: Elapsed Time Calculation

PostPosted: Thu Oct 01, 2009 7:59 pm
by Bill Dennis
The DATE field is separate from the TIME (hundredths of seconds since Midnight) so you need to work them individually. You must account for Julian date spanning days or even years (xx08365 to xx09001).

Re: Elapsed Time Calculation

PostPosted: Thu Oct 01, 2009 11:57 pm
by dick scherrer
Hi Bill,

Thanks for the clarification :)

Re-reading what i had posted, i see where i should have been more specific. Kinda left some holes :oops:

d