Please enable JavaScript to view this site.

 

int = LunarEclipseOnDate(nDate, nSunDataSourceIndex)

 

This macro function calculates the type and time of the lunar eclipse, as seen from any location on Earth, on nDate, using the Sun data source of index nSunDataSourceIndex.

 

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

If no lunar eclipse occurs on nDate, then the function returns -1.

 

To separate the type of eclipse from the time, use the div and mod function of the returned result, as shown in the code below.

nComboResult = LunarEclipseOnDate(n_TokenDate, 1)
if nComboResult > -1
    nEclipseType = nComboResult div 1000000
    sEclipseTypeName = LunarEclipseTypeName(EclipseType)
    nEclipseTime = nComboResult mod 1000000
    sEclipseTime = FormatTime('hh:nn', EclipseTime, true)
    sResult = EclipseTypeName + ' lunar eclipse at ' + EclipseTime 
else
    sResult = 'No lunar eclipse today'
endif

See also: LunarEclipseTypeName, LunarOccultationOnDate, SolarEclipseOnDate.

 


Topic 180035, last updated on 18-Apr-2020