Code Monkey home page Code Monkey logo

60-jiazi-is-sexagenary-cycle's Introduction

-

六十甲子的计算方式,一个开始我觉得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.

60-jiazi-is-sexagenary-cycle's People

Contributors

hossxosc8107 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.