int = TithiNumberOf(nWesternDate, nMoonSourceIndex, bSecondTithiIfExists)
•You can call this function with bSecondTithiIfExists set to true to check if there are 2 tithis in the same western day nWesternDate (ie. a leap day). This not common, but it does happen a few times a year.
•If there are no tithis in the day nWesternDate (ie. an expunged day), then the function returns -1. This not common, but it does happen a few times a year.
The macro code below checks if a date is the date of the Deepavali holiday of southern India (there are a few more subtleties in the actual calculation, but the code below gives the gist of it).
nCurTithiNumber = TithiNumberOf(n_TokenDate, 1, false)
nCurTithiTime = TithiTimeOf(n_TokenDate, 1, false)
nCurSunrise = SunRiseSetTimeOf(n_TokenDate, 1, 0)
bIsDeepavali = (nCurSunrise > nCurTithiTime)
bIsDeepavali = (nCurSunrise < nCurTithiTime)
bIsDeepavali = false
See also: TithiTimeOf.
Topic 179710, last updated on 18-Apr-2020