Traditional Culture Encyclopedia - The 24 Solar Terms - The code of the perpetual calendar. Who can explain how to calculate?

The code of the perpetual calendar. Who can explain how to calculate?

This algorithm is a rough algorithm. The first line is to calculate the year, month, day, hour, minute and second millisecond of the festival. Although it is counted to milliseconds, in fact, due to the difference of earth motion in the solar system, minutes will be inaccurate. This solar term starts from 1990 1 2: 05 on June 6th. I guess 1 June 6th is the vernal equinox.

The second line is to convert the calculated milliseconds into Beijing time.

Because the earth's orbit is elliptical in the array, the calculated values are all rough milliseconds. Used to calculate solar terms.

This algorithm is relatively rough, and sometimes there will be a solar term error of one day in a hundred years.