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.
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.
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 calendarWhere calendars differ
Time zone of the calendar
2 other conventions
Leap months
How solar-term moments are computed
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.
| Point of comparison | Solar calendar | Vietnamese lunar calendar |
|---|---|---|
| Basis | Earth's orbit around the Sun | Lunations; months start on the new moon |
| Days per month | 28–31 by fixed rule | 29 or 30, following the real lunar cycle |
| Days per year | 365 or 366 | 354–355; 383–385 in a leap year |
| How the drift is corrected | One extra day, 29 February | A whole extra month |
| How many dates one maps to | Always exactly one lunar date | A leap-month date maps to two solar dates |
| Time zone used | Not time-zone dependent | UTC+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
