Login
`
Templates, Tools and Utilities
|
||
Add a comment to an Icetips ArticlePlease 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!
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, 6:39 am This article has been viewed 35316 times.
|
|