Please enable JavaScript to view this site.

 

int = chDateSolarTermOnOrAfter(nWesternDate)

 

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

 

The example below displays the dates of the two solar terms in the western month and year supplied as input.

input
    nWesternMonth nWesternYear
var
   nFirstOfMonth nFifteenthOfMonth
   nDateMinorTerm nDateMajorTerm
begin
   // minor term is around the 5th of each month
    nFirstOfMonth = EncodeDate(nWesternYear, nWesternMonth, 1)
    nDateMinorTerm = chDateSolarTermOnOrAfter(nFirstOfMonth)
   // major term is around the 21st of each month
    nFifteenthOfMonth = EncodeDate(nWesternYear, nWesternMonth, 15)
    nDateMajorTerm = chDateSolarTermOnOrAfter(nFifteenthOfMonth)
   // 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)
end

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: chDateSolarTermOnOrBefore, Chinese Dates Functions.

 


Topic 176705, last updated on 11-Oct-2026