Fortune Telling Collection - Fortune-telling birth date - Lunar conversion

Lunar conversion

How to convert the national calendar into the lunar calendar? The first day of each month is called new moon, and the last day is called darkness. The fifteenth, sixteenth or seventeenth day of the lunar calendar is called Wangwang, and the day after Wangwang is called Wangwang, so New Year's Eve of the lunar calendar is not the same day every year. The basis of the lunar calendar is the year of the tropic of Capricorn and the first month. The tropic year is the time required for the sun to pass through vernal equinox twice in a row, that is, 365.2422 days (365 days, 5 hours, 48 minutes and 46 seconds). "The first month of the lunar calendar" is the time between two consecutive new moons (new moons) or two full moons (full moons), that is, 29.5306 days (June 29th 12 hours, 44 minutes and 3 seconds).

Because 12 "Wang Shuoyue" is only 354.3672 days, which is more than 10 days different from 365.2422 days in the tropic year, this difference adds up to a leap month. As early as the Spring and Autumn Period in 5600 BC, China calendar adopted the arrangement of seven leap months in 19 years.

However, the calculation method of China lunar calendar is different from that of * * * and Korean lunar calendar, which is generally one or two days apart.

The date of the lunar calendar is based on the full moon, and each new moon is the first day. The full moon is 15th (16th) and 29th (30th). However, at present, the date of the solar calendar is usually used to express the time. If you want to convert the date of the solar calendar into the date of the lunar calendar, you can use the following two methods: one is to search the newly edited perpetual calendar, for example, what is the date of the lunar calendar on June 8, 1984? Open the perpetual calendar, 10 June is the eleventh lunar month, so it is inferred that June 8 is the ninth day of the ninth lunar month. Secondly, we can use the formula to calculate the lunar calendar date:

Suppose: the number of AD years-1977 (or1901) = 4q+r.

Then: Lunar date =14q+10.6 (r+1)+date ordinal of the year-29.5n.

(Note: In the formula, q, r and n are all natural numbers, and the first day of each month is called new moon and the last day is called dark when the national calendar of r is converted into lunar calendar. The fifteenth, sixteenth or seventeenth day of the lunar calendar is called Wangwang, and the day after Wangwang is called Wangwang, so New Year's Eve of the lunar calendar is not the same day every year. The basis of the lunar calendar is the year of the tropic of Capricorn and the first month. The tropic year is the time required for the sun to pass through vernal equinox twice in a row, that is, 365.2422 days (365 days, 5 hours, 48 minutes and 46 seconds). "The first month of the lunar calendar" is the time between two consecutive new moons (new moons) or two full moons (full moons), that is, 29.5306 days (June 29th 12 hours, 44 minutes and 3 seconds). Because 12 "Wang Shuoyue" is only 354.3672 days, which is more than 10 days different from 365.2422 days in the tropic year, this difference adds up to a leap month. As early as the Spring and Autumn Period in 5600 BC, the calendar of China adopted the arrangement of seven leap months in nineteen years. However, the calculation method of China lunar calendar is different from that of * * * and South Korea, with a general difference of one or two days. The date of the lunar calendar is based on the full moon, and each new moon is the first day. The full moon is 15th (16th) and 29th (30th). However, at present, the date of the solar calendar is usually used to express the time. If you want to convert the date of the solar calendar into the date of the lunar calendar, you can use the following two methods: one is to search the newly edited perpetual calendar, for example, what is the date of the lunar calendar on June 8, 1984? Open the perpetual calendar, 10 June is the eleventh lunar month, so it is inferred that June 8 is the ninth day of the ninth lunar month. Secondly, we can use the formula to calculate the lunar calendar date: suppose: AD year-1977 (or 190 1) = 4q+r, then: lunar calendar date =14q+10.6 (r+

What is the formula for converting the lunar calendar into the Gregorian calendar? Because the Gregorian calendar (the Gregorian calendar is used now, and the Confucian calendar was used before) and the China lunar calendar are not calculated strictly according to a formula, there is no direct formula for the two calendars.

It is impossible to use a simple formula instead of using a lot of data like a perpetual calendar (although it can be simplified) to achieve the purpose of conversion between public and lunar calendar. All the software that we can see to convert Gregorian calendar into lunar calendar contains calendar data of different years.

Among these data, the most important is the number of days in each month of the lunar calendar. Because the lunar calendar is a lunar calendar, the part of the lunar calendar (according to the phase of the moon) determines a certain day in a month, and the part of the solar calendar (according to the height of the sun) is a solar term. Solar terms basically correspond directly to the Gregorian calendar, which is easy to calculate; However, the relationship between the moon phase period and the earth's revolution is relatively complicated, and generally requires astronomical observation data to give the time, so there is no simple formula for whether a lunar month is a big moon or a small moon.

As for the leap between the Gregorian calendar and the lunar calendar, there is a certain calculation method, which is not difficult.

If it is only astronomical data, it can still be counted-because the astronomical period is very stable, we only need to calculate it strictly according to the astronomical period. But there is another troublesome point, that is, the solar calendar and the lunar calendar are not strictly in accordance with the actual astronomical cycle, and there are many human factors. The most famous is that the Roman emperor revised the length of February and August for many times. Due to inaccurate calculation, the 10th was artificially deleted from julian calendar. In China, the calendar published by * * * is inconsistent with the astronomical phenomena because the ancient astronomical observations are inaccurate (we can't demand the accuracy of ancient observations). Therefore, these two calendars are related to a period of society, so there is no certain law to follow.

How to convert Gregorian calendar into lunar dimweek name (7), monthly addition (1 1), nonglidata (99), heavenly stems (9), earthly branches (1 1) and book fragrance (160) in EXCEL?

Dim curTime、curYear、curMonth、curDay、curWeekday

Dim GongliStr,WeekdayStr,NongliStr,NongliDayStr

Dim i,m,n,k,isEnd,bit,TheDate

Private Sub-Form _Load ()

Get the current system time

curTime = Now()

Name of the week

WeekName(0) = *

Day Name (1) = Sunday

WeekName(2) = Monday

WeekName(3) = Tuesday

WeekName(4) = Wednesday

WeekName(5) = Thursday

WeekName(6) = Friday

WeekName(7) = Saturday

Tianganming

Tiangan (0) = a.

Tiangan (1) = b.

Tiangan (2) = C.

Tiangan (3) = d

Tiangan (4) = E

Heavenly stems (5) = self-nature

Tiangan (6) = Geng

Tiangan (7) = Xin

Tiangan (8) = Ren

Tiangan (9) = decyl

Name of earthly branch

DiZhi(0) = child

Di Zhi (1) = Ugly

Ground straight (2) = Yin

Di Zhi ③ = Mao

Di Zhi (4) = Chen

Ground level (5) = Si

Ground straight (6) = noon

Di Zhi (7) = No.

Di Zhi (8) = Shen

Ground straight (9) = unitary

Vertical (10) = 0

Di Zhi (1 1) = sea

Animal constellation name

Shuxiang (0) = mouse

Shuxiang (1) = Niu

Shuxiang (2) = Tiger

Shuxiang (3) = Rabbit

Shuxiang (4) = Dragon

Shuxiang (5) = Snake

Shuxiang (6) = Ma

Shuxiang (7) = Sheep

Shuxiang (8) = Monkey

Shuxiang (9) = Chicken

Shuxiang (10) =&; q......& gt& gt

How to Convert Gregorian Years into Lunar heavenly stems and earthly branches In ancient China, heavenly stems and earthly branches was used to record years, but it was rarely used in modern society. First, today's society is inseparable from internationalization, and it is unrealistic to follow the old rules; Secondly, heavenly stems and earthly branches is mostly used for folk fortune-telling and word-testing, with a strong superstitious color, which is really incompatible with modern science and technology society. But an excellent nation will not abandon its own history and culture. In historical events, poems, calligraphy and painting, there are a lot of chronicles of heavenly stems and earthly branches, so we need to know and be familiar with him. Let's take a look at it a little: 1. The origin of heavenly stems and earthly branches is called "trunk" for short in heavenly stems and earthly branches, and heavenly stems and earthly branches is equivalent to trunk and leaves. They are an interdependent and coordinated whole. In ancient China, heaven was the "master" and the earth was the "slave". The interconnection between "heaven" and "dryness" is called "heavenly dryness"; The relationship between "earth" and "branch" is called "earth branch", which together is "heavenly stems and earthly branches". There are ten words for heavenly stems, which are always called "ten heavenly stems". There are twelve characters in the earthly branches, which are collectively called "Twelve Earthly Branches". In the original meaning of heavenly stems and earthly branches, there is an interesting saying: 1, heavenly stems (A) sprout like grass forest, and the yang is covered by yin. Others think that the armor of armor also highlights everything by breaking through its armor. (b) The vegetation is primary, with soft, elastic and slender branches and leaves. The second one is rolling. (C) C, C, like the bright sun, scorching fire, everything belongs to Ming Che. (d) vigorous, vegetation grows vigorously, just like a person's maturity. (e) Mao Ye symbolizes the lush vegetation on the earth. From (since), discipline is also, everything turns back, tangible and disciplined. (g) More importantly, the autumn harvest should wait until spring. (Xin) Jin Weixin, when things are done, they will taste. Others believe that the new is also new, and they are in awe of all changes and show new achievements. Pregnancy, when everything is pregnant, the sun is an elf lurking underground. (1) Yes, everything is hidden, gestated, underground and budding. 2, the ground branches (seeds) are also awkward, flowers and trees have children, and the water in the soil is sucked out, which is the beginning of a yang Meng. (Ugly) Cattle fields, where vegetation germinates, bends and leaves the ground. Swallow leaves, gold leaves, flowers and trees that bend in cold soil protrude from the ground to meet the spring day. (Ye Mao), Rizhao East, everything is thriving. (Chen) The earthquake also extended that everything was born from the earthquake, and the sun was over half. (3) Everything begins to grow, yin disappears, and pure yang has no yin. (noon) Hey, everything is full and full, the yang is full, and the yin is budding. Delicious (not delicious), ripe fruit is delicious. (Shen) Both the body and the object have grown up. You are still alive when you are old, and everything is still shrinking and converging. Extinction, vegetation withers, anger goes out. (sea) illegal, illegal killing, has reached the extreme. Heavenly stems and earthly branches is said to have been invented in ancient times four or five thousand years ago. For example, Liu Shu in the Tang Dynasty quoted an ancient book and said, "(The Yellow Emperor) made great efforts to govern …………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………… At first, our ancestors only used the sky to record the days, because the days of a month were carried by the days; Remember the months with earthly branches, because ten months in a year exactly match ten earthly branches. However, not long after, people think that there will still be three days in a month to record the days only by the sky. Therefore, a heavenly stem and a earthly branch are used to record dates in turn, such as Shangshu. Gu Ming says, "Only April is full of life. Kings don't make choices. Jia Zi, Wang Nai Tao Zanshui, was crowned with clothes. According to the records, this means that in early April, Wang felt very uncomfortable. On Jiazi Day, Wang Cai washed her hair and face. The servant dressed the king, and Wang Yi sat on the jade table. Later, the method of recording the day was gradually introduced to record the year, month and time. Sixty flowers Jia Zi China lunar calendar uses heavenly stems and earthly branches as the method to calculate the year, month, day and time, that is, each heavenly stems and earthly branches is paired in a certain order, without repetition, as the code of the year, month, day and time. Put a word in the front "heavenly stems" and a word in the back "earthly branches", thus forming a pair of stems and branches. If "Tiangan" starts with "A" and "Dizhi" starts with "Zi", we can get: 1. Jiazi 2. Picnic 3. Bing Yin 4. Ding Mao 5. Chen Wu 6. Jiu Si 7. Wu Geng 8. Xinwei 9. Ren Shen 10. & gt

The comparison table for converting the lunar calendar into the Gregorian calendar is Gregorian calendar1Sunday, April 29th, 945.

Conversion from Gregorian calendar to Gregorian calendar, Gregorian calendar and lunar calendar

(128× 365+3 1) day ÷ 128 = 365.438+0875 day/year.

It can be seen that the leap accuracy of * * * is much higher than that of modern Gregorian calendar.

2. Correction of one-day error in conversion

Calendar series takes 1387 January as an example, and calculates the year, month and day according to the Gregorian calendar.

Solution1:1387× 0.970224+621.5774 =1967.088.

0.278088× 365.2422 days = 10 1.569 days. The cumulative number of days in the Gregorian calendar is 10 1.57 days, which can be regarded as April 1 1 or April 12. What day is today? When two calendars have the same week ordinal number in April 1 1 or 12 of Gregorian calendar, it will be revised.

According to the calculation formula of ordinal number in the first week of Muharram:

[(138-1) ×131+164] ÷ 30 = 6057, with the remaining 20.

6057 ÷ 7 = 865, leaving 2.

So 1387' s New Year's Day is Tuesday. (Form)

According to the Gregorian calendar from1New Year's Day (Saturday, 583) to1April, 9671day, * * * calendar:

1967- 1583 = 384. In these 384 years, the Gregorian calendar has a leap of four years, but there is no leap of one hundred years. The rule of adding a leap day in 400 years * * * has 93 leap days, from1the day after New Year's Day in 967 to April 165438.

(384× 365+93+100+6) ÷ 7 =140359+7 = 2001,and the remaining 2 is Tuesday, so the New Year's Day of Ramadan 1387 falls on the Gregorian calendar/kloc-.

Because the Gregorian calendar uses a lot of data to calculate the number of Sundays, there are inevitably some omissions in the calculation. Now we introduce the calendar date and week calculation table for your reference.

Use this table to find the day of April 1967+ 1 1. The steps are as follows:

First, find the position of the word 19 in the first two digits of this year table;

Then find the position of the word 67 in the last two digits of the year table, and move to the right in parallel from the word 19, and the word 67 moves vertically downward, and the two words intersect at the letter G in the English capital column;

Then check April from the column of the monthly table, move from the position of April to the left in parallel, and check the position of G in the column of April;

Find the position of 1 1 from the date column, and move from this position to the right in parallel, so that the intersection of April and G column is called Tuesday, and the result is the same as that calculated in Hijri. So we know that New Year's Day 1387 is indeed 1967 April1,not 12.

In conversion, Gregorian calendar days often exceed 365,438+0 days, or even 200-300 days. When this number needs to be converted into the month and day of the year, you can use the following two tables.

Table 3 Gregorian calendar months and their cumulative days

Convert Gregorian calendar into hijri calendar

The formula of converting Gregorian calendar into Gregorian calendar can be obtained by shifting and sorting.

(Gregorian calendar 1 year 621.5691) ÷ 0.9702 = Muhalam (julian calendar) .............................. (5)

(Gregorian calendar 1 year 62 1.5774) ÷ 0.970224 = Muharram (Gregorian calendar) ......................... (6)

Whether hijri is converted to Gregorian calendar or not, there is usually a difference of one day. When the number of weeks is modified, the hijri calendar is converted into Gregorian calendar, and the number of weeks in hijri calendar shall prevail; On the contrary, the number of weeks in the Gregorian calendar shall prevail.

Four national calendars or Gregorian calendars were converted into the China lunar calendar.

1. Conversion from hijri to lunar calendar

Although the number of months in China lunar calendar is not a relatively stable value, which brings more difficulties to the conversion of solar calendar and Gregorian calendar into lunar calendar, it can still be converted. The lunar calendar in China is a combination of yin and yang, which belongs to the lunar calendar in terms of months. However, every month in Muharram, the new moon is 1 the beginning of the month, and its date is about 1-2 or even 3 days after the new moon (the first day of the lunar calendar). So as long as the relationship between them is clear, the hijri calendar can be converted into the China lunar calendar. Mr. Ma said to him, "> >;

7. 13 What's the date of the lunar calendar? 13 the first day of the eighth lunar month15,2065438.

The inquiry information on July 20 16 13 is as follows:

Gregorian calendar: 20 16 August 15 Monday Leo

Lunar calendar: four pillars, July 13th, Year of the Monkey: C, Ji Shen, four solar terms: mid-autumn 20th: Xuanyuan 28th birthday: Xu Jiazi, Yin Na: Dalinmuxian:100th day left.

I don't know much about the programming of lunar conversion algorithm.

Pass on the formula.

Multiply by five and divide by four and nine days.

The interval between two months is thirty days.

One, two, plus one, minus one,

The top ten tails of 3578.

The specific algorithm can be found online. There is a lot of information on Baidu, so I won't go into details.