` Time calculations greater than 24 hours (Sue Pichotta ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Time calculations greater than 24 hours
2000-02-07 -- Sue Pichotta
 
LTimeStart and LTimeEnd are decimals. The trick is, the date is stored in the integer area, to the left of the decimal point, and the time is stored in the fractional area, to the right of the decimal point. Makes calculations across days easy. (Greg Bailey taught me this trick in my Compuserve days, and this paid for me going to DevCon one year - was the basis of a talk I gave. ) LTimeStart = PAT:Sign_In_Date + (PAT:Sign_In_Time / 8640000) LTimeEnd = PAT:Triage_Start_Date + (PAT:Triage_Start_Time / 8640000) LWait = (LTimeEnd - LTimeStart) * 1440 ! change this number to break it into min/sec IF LWait > 59 ! greater than one hour LHrs = LWait / 60 LMin = LWait % 60 LSignInTriageWait = (FORMAT(LHrs,@N3)) & ':' & (FORMAT(LMin,@N02)) ELSE LSignInTriageWait = ' :' & (FORMAT(LWait,@N02)) END (Also, remember when working with time, 0 = nothing, doesn't register. 1 is the lowest valid value, 1/100 of a second past midnight.)


Today is April 20, 2024, 9:39 am
This article has been viewed 35109 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: