Please enable JavaScript to view this site.


int = HeliacalEventOnDate(nDate,nSunSourceIndex,nPlanetOrStarID,nEventType)


This macro function returns the time when a heliacal event of type nEventType occurs on nDate, for the astronomical body nPlanetOrStarID, using the sun data source of position nSunSourceIndex.


The possible values for nPlanetOrStarID are given in the topic astronomical bodies indices.

The 4 possible choices for nEventType are: heliacal rise (nEventType=1), heliacal setting (nEventType=2), acronycal rise (nEventType=3), and acronycal setting (nEventType=4).

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

If a heliacal event of nEventType involving the astronomical body nPlanetOrStarID, does not occur on nDate, then the function returns -1.


The macro code below uses HeliacalEventOnDate to look for the Maori New Year (Matariki), which corresponds to the new Moon which follows the heliacal rise of the Pleiades star cluster (see historical follow-up below).

nEventType = 1 // heliacal rise
nAstroBody = 29 // Alcyone, the brightest star in the Pleiades
// look from mid-May to the end of June
nHeliacalDate = 0
for nRunDate = EncodeDate(nYear,5,15to EncodeDate(nYear,6,30)
   nHeliacalTime = HeliacalEventOnDate(nRunDate,1,nAstroBody,nEventType)
   if nHeliacalTime >= 0
      nHeliacalDate = nRunDate
      break // found it
Assert(nHeliacalDate > 0'heliacal event not found', true)
// now look for the new Moon that follows
nMatarikiDate = 0
for nRunDate = nHeliacalDate to EncodeDate(nYear,6,30)
   nNewMoonTime = MoonPhaseAndTimeOf(nRunDate,1,false)
   // do we have a phase and if so a new Moon ?
   if (nNewMoonTime > 0and (nNewMoonTime div 1000000 == 1)
      // if the new Moon is on the exact date of the heliacal rise
      // make sure that the time of the new Moon is after it
      if nRunDate == nHeliacalDate
         // New Moon must be after heliacal rise
         if (nNewMoonTime mod 1000000) > nHeliacalTime
            nMatarikiDate = nRunDate
            break // found it
            // too early keep looking for the next new Moon
         nMatarikiDate = nRunDate
         break // found it
Assert(nMatarikiDate > 0'Matariki not found', true)
// at the end
sResult = 'Maori New Year on ' + FormatDate('Dddd, Mmmmm d, yyyy', nMatarikiDate)

Historical follow-up


The above code is based on the way Matariki was calculated up to, and including, 2021. But, when Matariki was added as an official non-working public holiday in New Zealand, beginning in 2022, a Matariki Advisory Group was created, comprising experts in Mātauranga Māori (Māori knowledge), tasked with the determination of the dates of the Matariki public holiday for the next 30 years. The result was a list of hard-coded dates for the occurrence of Matariki in the next 30 years.


See also: astronomical bodies indices and planetary events indices.


Topic 180070, last updated on 30-Oct-2023