Skip to content

Lunar–solar converter

Convert a solar date to the lunar calendar or back, with the day and year stems and branches and the solar term. If the lunar year has a leap month, you choose the leap or the regular month. A third mode counts the days between two dates.

Calendar and astronomyComputed and cross-checked.

Where this comes from

Ho Ngoc Duc's algorithm for the Vietnamese lunar calendar, using Jean Meeus's formulas for the new moon and the Sun's longitude, computed in Vietnam time (UTC+7). Day 1 is the date containing the new moon; the leap month is the first month with no principal solar term.

Checked againstNASA: 2,474 new moons, 1901 to 2100; IMCCE: 4,824 solar-term instants, 1900 to 2100; USNO: 804 equinoxes and solstices, 1900 to 2100.

Classical allusion

“Cư trần lạc đạo thả tuỳ duyên, cơ tắc xan hề khốn tắc miên.”

Translation: Dwell in the world, delight in the Way, and follow what comes: eat when hungry, sleep when tired.

Trần Nhân Tông · Rhapsody on Dwelling in the World and Delighting in the Way

Next

Vietnamese lunar calendar

Want the whole lunar month with stems, branches and festivals? The lunar calendar lays out the full month.

Open Vietnamese lunar calendar

Where calendars differ

Time zone of the calendar

Nhật Nguyệt usesEvery year is computed in UTC+7 (Hanoi time), including years when Vietnamese calendars were still printed in UTC+8; the site does not switch time zones by year or by region. As a result, between 1950 and 2050 the site's Tết differs from Chinese New Year (UTC+8) in 1965, 1968, 1969, 1985, 2007 and 2030.
The other wayVietnamese calendars followed Beijing time, UTC+8, until 8 August 1967 in the North and until 1975 in the South. By the calendar of the day, Tết 1965 fell on 2 February (the site gives 1 February); Tết 1968 was 29 January in the North and 30 January in the South; Tết 1969 in the South was 17 February (the site gives 16 February). For dates in the South before 1975, also check a UTC+8 calendar.
2 other conventions

Leap months

Nhật Nguyệt usesWhen 13 new moons fall between two months 11 (the month holding the winter solstice), the first month without a principal term is the leap month and takes the number of the month before it. Principal terms are judged in UTC+7. Checked against a calendar rebuilt by this same rule from NASA new-moon times and IMCCE principal terms: 2,459 of the 2,461 lunar months from 1901 to 2100 match, including all 73 leap months; in the other two, starting 9 December 2072 and 19 October 2085, the new moon falls within a minute of midnight and the site's day 1 is one day off. The Tử Vi chart places stars by month number and treats a leap month like the regular month of that number.
The other wayThe Chinese calendar applies the same rule in UTC+8, so a leap month or a day 1 can differ from the Vietnamese one: China had a leap month 10 in 1984 while Vietnam had a leap month 2 in 1985; in 2031 the leap month 3 starts a day earlier in Vietnam. Some Tử Vi schools split a leap month: days 1 to 15 count as the previous month, day 16 onward as the next.

How solar-term moments are computed

Nhật Nguyệt usesThe Sun's apparent longitude from Jean Meeus's short formula, with aberration, nutation and ΔT; each term's moment is found by bisection to within a minute, in Vietnam time. Against the INPOP ephemeris of IMCCE (Paris Observatory) for 4,824 moments from 1900 to 2100, and the US Naval Observatory for equinoxes and solstices: 3 minutes early on average, 14 minutes at most. Term dates match for 4,814 of the 4,824 moments; the 10 that differ all fall within 15 minutes of midnight.
The other wayObservatories use full ephemerides accurate to the second. Chinese calendars count in UTC+8, so a term beginning between 23:00 and 24:00 Vietnam time falls on the next date there.

What no one has shown

This is a computation; no part of it is belief. Its limits are the error of the astronomical algorithm, measured and published in the model profile, and the points where calendars choose differently, such as time zone and the day boundary.

Read on

Ask Nhật Nguyệt AI

Learn more

Why is converting lunar to solar trickier than the other way?

The solar calendar follows Earth around the Sun, with a fixed number of days per month except February in leap years. The lunar calendar follows the Moon: each month starts on the new moon day and lasts 29 or 30 days depending on the year. Twelve lunar months make only about 354 days, so a leap month is added every few years.

Converting solar to lunar always gives one answer. Lunar to solar needs one more fact: in a year with a leap month, say a leap sixth month, the 15th of the sixth month happens twice, about a month apart. That is why you are asked whether you mean the leap month or the regular one.

The lunar date is entered in three number boxes (day, month, year) rather than the phone's date picker, because the picker is a solar calendar and will not let you choose 30 February. If you enter the 30th of a lunar month that has only 29 days, or tick leap for a month with no leap, you are told the date does not exist.

Results include the day and year stems and branches and the solar term. The stem and branch are what you usually need next: choosing a day, checking an age, comparing with a paper calendar. The 24 solar terms follow the Sun's position, so they stay nearly fixed on solar dates even though they are printed in the lunar calendar.

The span mode counts days from the first date to the last, not counting the first date itself: 1 January to 31 December of the same year is 364 days. Weeks and months are only approximate, because solar months run from 28 to 31 days.

How the two calendars differ
Point of comparisonSolar calendarVietnamese lunar calendar
BasisEarth's orbit around the SunLunations; months start on the new moon
Days per month28–31 by fixed rule29 or 30, following the real lunar cycle
Days per year365 or 366354–355; 383–385 in a leap year
How the drift is correctedOne extra day, 29 FebruaryA whole extra month
How many dates one maps toAlways exactly one lunar dateA leap-month date maps to two solar dates
Time zone usedNot time-zone dependentUTC+7 for Vietnam, UTC+8 for China

Frequently asked questions

Why is there a "leap month" checkbox?

Because in a leap year that month appears twice, and a lunar date like the 15th of the sixth month maps to two different solar dates. Leave it unticked for the regular month.

Why does the Vietnamese lunar calendar sometimes differ from the Chinese one by a day?

Because Vietnam computes on UTC+7 and China on UTC+8. The new moon happens at a specific minute; when it falls near midnight, one hour is enough to move day 1 to another date. That is also why Tết sometimes falls on different days in the two countries.

How often is there a leap month?

About every 2 to 3 years, or more exactly 7 times in 19 years. The leap month takes the number of the month before it; in 2025, for example, a leap sixth month came after the sixth month.

Are the solar terms lunar or solar?

Solar, even though they are printed in the lunar calendar. The 24 terms follow the Sun's position, 15 degrees apart, so they stay close to fixed solar dates: Lập Xuân around 4 February, Đông Chí around 21 or 22 December.

Does the day count include the first date?

No. From the 1st to the 2nd is 1 day. To count both ends, as for the length of a trip, add 1.

Is conversion reliable for distant years?

The calculation rests on astronomical positions, so it reaches far in both directions. The calendar people actually used also depended on the rules of each period; the years when Vietnam printed calendars on Beijing time are one example, and a few dates then can differ from the printed calendar.

Public API, returns JSON, no sign-in: GET https://api.nhatnguyet.org/api/v1/calc/doi-lich?d=2027-01-01; GET https://api.nhatnguyet.org/api/v1/calc/doi-lich?am=2027-01-01