Please enable JavaScript to view this site.

 

str = MoonPhaseName(nMoonPhaseIndex)

 

This macro function returns the name of the Moon phase corresponding to the value nMoonPhaseIndex, as specified in the current moon and sun options as shown in the image on the right for the [mt] token.

 

➢If you supply the value of nMoonPhaseIndex yourself, be sure to supply the correct index, as described here (the four main phases have indices 1, 3, 5, and 7; they are not numbered consecutively from 1 to 4).

 

This value of nMoonPhaseIndex could have come from a previous call to MoonPhaseOf as shown in the example below.

nMoonPhaseIndex = MoonPhaseOf(nDate, 1, false)
switch nMoonPhaseIndex
   case 0
      sRESULT = 'No moon phase today'
   else
      sRESULT = MoonPhaseName(nMoonPhaseIndex) + ' today'
endswitch

See also: MoonPhaseAndTimeOf, MoonPhaseOf, MoonPhaseSymbol.

 


Topic 177675, last updated on 17-Oct-2026