` Stardate (time calculations over 24 hours) ( Mark ) - 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: Stardate (time calculations over 24 hours)
2000-03-08 -- Mark
 
[Originally published by Susan Alchesay in Clarion Tech Journal] what you are describing is something we call a "StarDate". It is normally stored in a decimal 13.6 (Makes CPD 21.10 keys happier than reals. Much less likely to need rebuilding). It is constructed as follows. StarDate = Today() + (Clock() / 8,640,000) When formatted as an @d??, you can see the date portion. For the time, multiply the decimal portion by 8,640,000 to get a clarion standard time. In LPM2.5, there are a couple functions for using StarDates. They port over to CW very easily. If you don't have LPM, they break down like this: StarDate( Date, Time ) If Date is omitted, assume TODAY(). If Time is omitted, assume CLOCK(). Return( Today + (Time / 8640000 ) StarTime( StarDate ) If Time is omitted, return( CLOCK(). ) return( ( StarDate - int( StarDate ) ) * 8640000 )


Today is November 21, 2024, 3:30 am
This article has been viewed 35315 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: