Please enable JavaScript to view this site.


str = PlanetInConstellationName(nDate, nTimeOfDay, nPlanetID, nMoonSourceIndex, bTopocentric)


This macro function returns the name of the astronomical constellation in which the planet nPlanetID is, at nTimeOfDay on nDate, for an observer using the Moon data source of index nMoonDataSourceIndex.


The allowed values for nPlanetID range from n_MERCURY to n_PLUTO, and also include n_SUN and n_MOON.

The names and abbreviations of the constellations correspond to the 88 constellations recognized by the International Astronomical Union (IAU).

The value of the parameter nTimeOfDay must be supplied to the function in one millionth of a day (less than 1/10th of a second), preferably using the function MillionFromHMS to avoid any error.


The macro code below gets the name and abbreviation of the constellation in which the Moon is at 7am on the date of an incoming macro token.

nTime = MillionFromHMS(7,0,0)
sName = PlanetInConstellationName(n_TokenDate,nTime,n_MOON,1,true)
sAbbrev = PlanetInConstellationAbbreviation(n_TokenDate,nTime,n_MOON,1,true)
sResult = 'Moon is in ' + sName + ' (' + sAbbrev + ')'

Note that this is an astronomical function based on the real position of the planets in the sky (as opposed to the astrological signs which are simple divisions on the longitude angles).


See also: PlanetInConstellationID and PlanetInConstellationAbbreviation.


Topic 179940, last updated on 18-Apr-2020