Please enable JavaScript to view this site.

 

int = MoonRiseSetTimeOf(nDate, nMoonSourceIndex, nEventIndex)

 

This macro function calculates the time of the lunar rise, set or transit event of index nEventIndex, on nDate, based on the observer position corresponding to the Moon data source of index nMoonSourceIndex.

 

The result is the time of the day expressed in one millionth of a day (less than 1/10th of a second).

The possible values of nEventIndex are: 0 (moonrise), 1 (moonset), and 2 (upper transit, aka. in the south).

If no lunar rise, set or transit event of index nEventIndex occurs on nDate, then the function returns -1.

 

The macro code below displays the times of the lunar rise, set or transit event of index nEventIndex, on nDate.

sResult = ''
nEventTime = MoonRiseSetTimeOf(n_TokenDate, 10)
if nEventTime >= 0
   sResult = 'Today, the Moon rises at ' + FormatTime('hh:nn', nEventTime, true) + ', '
else
   sResult = 'Today, the Moon does not rise, '
endif
nEventTime = MoonRiseSetTimeOf(n_TokenDate, 12)
if nEventTime >= 0
   sResult = sResult + 'transits at ' + FormatTime('hh:nn', nEventTime, true) + ', '
else
   sResult = sResult + 'does not transit, '
endif
nEventTime = MoonRiseSetTimeOf(n_TokenDate, 11)
if nEventTime >= 0
   sResult = sResult + 'and sets at ' + FormatTime('hh:nn', nEventTime, true) + '.'
else
   sResult = sResult + 'and does not set.'
endif

See also: SunRiseSetTimeOf.

 


Topic 179985, last updated on 18-Apr-2020