` Parsing Clarion times (Randy Goodhew ) - 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: 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 April 20, 2024, 9:03 am
This article has been viewed 35123 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: