` 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: Parsing Clarion times
2006-10-18 -- Randy Goodhew
 
You can instantly parse a Clarion Standard Time (as a LONG) into its time components by using this trick: BTime TIME,AUTO BTovr GROUP(BTime) Hundredths BYTE Seconds BYTE Minutes BYTE Hours BYTE END !group TTime LONG CODE BTime = TTime ! auto-converts Clarion Time to Btrieve Time Now you can get each time component from the over cast array, e.g. BTovr.Hours BTovr.Minutes BTovr.Seconds BTovr.Hundredths Note: When Clarion auto-converts a Clarion Standard Time (LONG) to a Btrieve Time, it automatically subtracts 1, the Midnight bias value. Also, you can get AM/PM directly from the TTime LONG by using these EQUATEs to do comparisons: NoTime EQUATE(0) Midnight EQUATE(1) Noon EQUATE(4320001) MaxTime EQUATE(8640000) EndOfAM EQUATE(Noon - Midnight) EndOfPM EQUATE(MaxTime) Example: AMPM STRING(2) CODE IF TTime => Midnight AND TTime =< EndOfAM AMPM = 'AM' ELSIF TTime > EndOfAM AND TTime =< EndOfPM AMPM = 'PM' ELSE AMPM = '' END !if


Today is May 3, 2024, 8:56 pm
This article has been viewed 35131 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: