Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >


Previous pageReturn to chapter overviewNext page

int = chDateSolarTermOnOrBefore(nAnyRegularDate)


This macro function returns the closest date, on the date of nAnyRegularDate or before, on which a Solar Term occurs. Note that this function returns the date of the most recent Solar Term, not its name or index. The result of this function is usually used, as in the example below, to modify the date of the incoming token.



   bResult = true

   sResult = '[' + s_LangDayToken + ']'

   nResult = chDateSolarTermOnOrBefore(LastDateOfMonth(n_TokenYear, n_TokenMonth))



The above example will shift the date of any incoming token to the date of the last solar term of the current Gregorian month. Note that there are never more than 2 solar terms for any given month (either Gregorian or Chinese Lunar), 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 updated on 01-Nov-2016.
Topic URL: