Please enable JavaScript to view this site.


int = chDateSolarTermOnOrBefore(nWesternDate)


This macro function returns the date of the first Chinese solar term, on or before nWesternDate.


The above example displays the date of the 2 solar terms of the current western month.

    nWesternMonth nWesternYear
   nMidMonth nEndMonth
   nDateMinorTerm nDateMajorTerm
   // minor term is around the 5th of each month
    nMidMonth = EncodeDate(nWesternYear, nWesternMonth, 15)
    nDateMinorTerm = chDateSolarTermOnOrBefore(nMidMonth)
   // major term is around the 21st of each month
    nEndMonth = EncodeDate(nWesternYear, nWesternMonth, 28)
    nDateMajorTerm = chDateSolarTermOnOrBefore(nEndMonth)
   // display the 2 solar term dates as text
    sResult = 'Minor term on = ' + FormatDate('ddd d', nDateMinorTerm)
    sResult = sResult + chr(13// break to next line
    sResult = sResult + 'Major term on = ' + FormatDate('ddd d', nDateMajorTerm)

The above example relies on the fact that there are never more than 2 solar terms for any given western month, and that the minor term usually occurs around the 5th of each month, and the major term around the 21st of each month (plus or minus 2 days).


See also: chDateSolarTermOnOrAfter, chinese dates functions.


Topic 176710, last updated on 18-Apr-2020