Please enable JavaScript to view this site.

 

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).

 

The macro code below extracts the hours, minutes and seconds from the time obtained for a Moon phase.

nNewMoonTime = MoonPhaseAndTimeOf(n_TokenDate,1,false)
if (nNewMoonTime > 0)
   nHrs = HoursFromMillion(nNewMoonTime)
   nMins = MinutesFromMillion(nNewMoonTime)
   nSecs = SecondsFromMillion(nNewMoonTime)
   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 18-Apr-2020