` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

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

Par2: Time calculations with midnight rollover
1998-02-08 -- Bernard Grosperrin
 
This was presented at Devcon 97 by Sue Alchesay. To calculate elapsed time in Clarion, use both time and date together..... create a real variable, with Clarion standard date on the left side of the decimal point and Clarion standard time on the right side, by dividing it by 8640000. (number of 1/100th of seconds in one day..) That way, with only one variable, you can do standard calculations and get an age from 1/100th of a second to years, at once, in one single calculation. Example : program map end Beginning REAL Ending REAL ElapsedTime REAL ElapsedDays LONG EndDate LONG CODE beginning = Today() + (Clock()/8640000) ! age between now EndDate = DATE(Month(Today())+1,1,Year(Today())) ! and last day, this month Ending = EndDate - 1/8640000 ! at midnight (or first 1/100 of second, next month....) ElapsedDays = INT(Ending) -INT(beginning) ElapsedTime = Ending - Beginning Message('We are ' & ElapsedDays & ' Days, and ' & FORMAT(((ElapsedTime-Elapseddays)*8640000),@t4) & ' Hours before Midnight, next month')


Today is November 21, 2024, 6:39 am
This article has been viewed 35270 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: