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 above example displays the date of the 2 solar terms of the current western month.

input
    nWesternMonth nWesternYear
var
   nFirstOfMonth nFiftennthOfMonth
   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
    nFiftennthOfMonth = EncodeDate(nWesternYear, nWesternMonth, 15)
    nDateMajorTerm = chDateSolarTermOnOrAfter(nFirstOfMonth)
   // 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 18-Apr-2020