六十甲子的计算方式,一个开始我觉得chatpgt能计算天干地支,后来我发现它对天干地支的理解一塌糊糊,它把**农历和天干地支的计算方法混在一起了。 **的天干地支计算方式,是针对年,月,日,时辰; 每一年会对应一个天干地支,每一个月也会对应天地支,日子和时辰也一样,循环反复。 每一个月的分界线是以二十四节气的节,就是太阳在黄道的位置来划分的,一月就是大约每年的2月4日,立春,太阳在黄道315度左右。 我在这里用python编程语言,编辑一个简单计算日子对应六十甲子的程序,希望能帮助到有需要的人。程序已经验证计算正确。
The calculation method of the 60 Jiazi (Sexagenary cycle)is based on the year, month, day, and hour. Each year corresponds to a heavenly stem and earthly branch, and each month also corresponds to a heavenly stem and earthly branch. The same applies to days and hours, and the cycle repeats. The boundary of each month is divided by the 24 solar terms, which is based on the position of the sun on the ecliptic. For example, the first month is approximately February 4th each year, which is the solar term of "立春 (Lichun)" when the sun is around 315 degrees on the ecliptic.
At first, I thought that ChatGPT could calculate the heavenly stem and earthly branch, but I found that it had a poor understanding of the calculation method of the Chinese lunar calendar and the heavenly stem and earthly branch. The calculation method of the heavenly stem and earthly branch in China is based on the year, month, day, and hour. I wrote a simple program in the Python programming language to calculate the heavenly stem and earthly branch corresponding to a given date, and I hope it can help those in need. The program has been verified to be correct.
If you got confused with Chinese calendar calculation, please leave a comment.