` Printed Icetips Article

Icetips Article



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 )



Printed May 4, 2024, 3:13 pm
This article has been viewed/printed 35128 times.