int = HoursFromMillion(nTimeTimesMillion)
This macro function returns the hour (from 0-23) corresponding to the time nTimeTimesMillion.
➢The number nTimeTimesMillion is the portion of the day expressed in one millionth of a day (less than 1/10th of a second).
Supply a time in the range 0 to 1000000. The complete time is rounded to the nearest whole second before its hour, minute or second component is extracted, so carries between components are handled together. Values that would round past 23:59:59 are kept at 23:59:59; the special value 1000000 also represents 23:59:59. These functions return clock components, not totals of elapsed hours, minutes or seconds.
The macro code below extracts the hours, minutes and seconds of a Moon phase. MoonPhaseAndTimeOf returns a packed phase index and time; first use mod 1000000 to extract the time component. Pass this component, not the packed result, to the time-conversion functions. A time component of 0 is valid midnight at the start of the date.
sResult = ''
nPhaseAndTime = MoonPhaseAndTimeOf(n_TokenDate,1,false)
if nPhaseAndTime > 0
nPhaseTime = nPhaseAndTime mod 1000000
nHrs = HoursFromMillion(nPhaseTime)
nMins = MinutesFromMillion(nPhaseTime)
nSecs = SecondsFromMillion(nPhaseTime)
sResult = 'Moon phase at '+IntToStr(nHrs)+':'+IntToStr(nMins)+':'+IntToStr(nSecs)
endif
To avoid confusion between the midnight at the beginning of the day, and the midnight at the end of the day, a value of 1000000 for nTimeTimesMillion will be converted to 23:59:59.
See also: MinutesFromMillion, SecondsFromMillion, MillionFromHMS
Topic 179965, last updated on 14-Oct-2026