# Lunar Calendar Converter (农历)

> Converts a Gregorian date to the Chinese lunisolar calendar (农历 nongli): lunar year, month (with leap-month flag), day, the sexagenary stems and branches (干支 ganzhi) of year, month and day, zodiac animal, nayin (纳音), the current 24-solar-term period and any traditional festival on that day.

- Calculator id: `lunar-calendar-converter` · Category: Chinese Calendar (`lunar`) · Tool name: `convert_solar_to_lunar`
- Canonical page: https://tttkmbb.com/lunar/lunar-calendar-converter · This document: https://tttkmbb.com/lunar/lunar-calendar-converter.md · JSON definition: https://tttkmbb.com/lunar/lunar-calendar-converter.json

## Purpose

Converts a Gregorian date to the Chinese lunisolar calendar (农历 nongli): lunar year, month (with leap-month flag), day, the sexagenary stems and branches (干支 ganzhi) of year, month and day, zodiac animal, nayin (纳音), the current 24-solar-term period and any traditional festival on that day.

**Use when:** You need the Chinese lunar date, ganzhi day/month/year, zodiac year or current solar term for a given Gregorian date (defaults to today).

**Do not use when:** You start from a lunar date and need the Gregorian date (use lunar-to-solar), need a person's zodiac with the 立春 boundary option (use chinese-zodiac), or need the astronomical moon phase (use moon-phase).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `date` | date |  | optional, default "today" | Civil date in China Standard Time (UTC+8), 1900–2100; defaults to the current UTC date. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `lunar_year` | integer |  | Lunar year number (the year that began at the preceding Chinese New Year). |
| `lunar_month` | integer |  | Lunar month number 1–12. |
| `is_leap_month` | boolean |  | true when the date falls in an intercalary month (闰月 runyue). |
| `lunar_day` | integer |  | Day of the lunar month, 1–30. |
| `lunar_date_chinese` | string |  | Written form, e.g. 二〇二六年八月十四. |
| `lunar_date_text` | string |  | Readable form, e.g. 8th lunar month, day 14 (八月十四). |
| `month_name` | string |  | Traditional month name (正月 … 腊月, prefixed 闰 for a leap month). |
| `day_name` | string |  | Traditional day name (初一 … 三十). |
| `month_days` | integer |  | Length of this lunar month (29 or 30). |
| `leap_month_this_year` | integer |  | Number of the leap month in this lunar year, 0 when the year has none. |
| `year_ganzhi` | string |  | Sexagenary year of the lunar year, e.g. 丙午. |
| `year_ganzhi_pinyin` | string |  | Pinyin of the year ganzhi, e.g. Bingwu. |
| `year_english` | string |  | Stem element and zodiac animal, e.g. Fire Horse. |
| `zodiac` | string |  | Zodiac animal of the lunar year with its character, e.g. Horse (马). |
| `nayin_year` | string |  | Nayin melodic element of the year ganzhi, e.g. 天河水 · Milky-way Water. |
| `month_ganzhi` | string |  | Sexagenary month by solar-term months (节气月): 寅 month starts at 立春, stems by the 五虎遁 rule. |
| `month_ganzhi_pinyin` | string |  | Pinyin of the month ganzhi. |
| `day_ganzhi` | string |  | Sexagenary day (continuous 60-day cycle; 1949-10-01 = 甲子). |
| `day_ganzhi_pinyin` | string |  | Pinyin of the day ganzhi. |
| `weekday` | string |  | Day of the week. |
| `current_solar_term` | string |  | Solar-term period the date falls in and the date it began. |
| `next_solar_term` | string |  | Next solar term and its date. |
| `days_to_next_term` | integer | days | Days until the next solar term. |
| `is_solar_term_day` | boolean |  | true when the date is itself a solar-term day. |
| `festival` | string |  | Traditional festival(s) on this day (春节, 元宵节, 龙抬头, 上巳节, 端午节, 七夕, 中元节, 中秋节, 重阳节, 寒衣节, 下元节, 腊八节, 小年, 除夕, 清明节, 冬至) or "none". |
| `julian_day_number` | integer |  | Julian Day Number of the civil date. |

## Formula

`lunar month = interval between successive new moons (instants at 120° E, UTC+8); month 11 contains the winter solstice; a leap month is the first month without a major solar term (中气) in a 13-month solstice-to-solstice suite; year_ganzhi index = (lunar_year − 4) mod 60; day_ganzhi index = (JDN + 49) mod 60; month branch = 寅 from 立春, one branch per odd solar term`

Astronomical computation (Meeus VSOP87 solar longitude, Meeus ch. 49 new moons, Espenak–Meeus ΔT) following the GB/T 33661-2017 rules, checked against Hong Kong Observatory tables; pre-1929 dates use Beijing local mean time as the published calendars did. Traditional calendar/cultural reference calculation; not a prediction, medical, legal or financial advice.

## Data Sources

- Chinese calendar (Wikipedia) – calendar rules as standardised in GB/T 33661-2017 — https://en.wikipedia.org/wiki/Chinese_calendar (reference, retrieved 2026-09-24)
- Hong Kong Observatory – Gregorian-Lunar Calendar Conversion Table — https://www.hko.gov.hk/en/gts/time/conversion.htm (government, retrieved 2026-09-24)
- Meeus J. (1998) Astronomical Algorithms, 2nd ed., Willmann-Bell (solar longitude, nutation, ΔT, new moons) — https://en.wikipedia.org/wiki/Jean_Meeus (textbook, retrieved 2026-09-24)

Data freshness: `daily` (max_age_seconds 86400). Depends on the current date.

## API

- `GET https://tttkmbb.com/api/v1/calculate/lunar-calendar-converter?`
- `POST https://tttkmbb.com/api/v1/calculate/lunar-calendar-converter` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/lunar-calendar-converter · OpenAPI operationId `convert_solar_to_lunar` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool: `convert_solar_to_lunar` (dedicated) or `run_calculator` with `{"calculator_id": "lunar-calendar-converter", "inputs": {…}}`

## Example

- 2026-09-24 (八月十四, 丙午年): inputs `{"date":"2026-09-24"}` → `{"lunar_month":8,"lunar_day":14,"is_leap_month":false,"lunar_date_chinese":"二〇二六年八月十四","year_ganzhi":"丙午","month_ganzhi":"丁酉","day_ganzhi":"辛丑","zodiac":"Horse (马)","current_solar_term":"秋分 (Qiufen, Autumn Equinox) since 2026-09-23","days_to_next_term":14,"festival":"none","julian_day_number":2461308}`
- 2025-07-25 (闰六月初一): inputs `{"date":"2025-07-25"}` → `{"lunar_month":6,"is_leap_month":true,"lunar_day":1,"lunar_date_chinese":"二〇二五年闰六月初一","year_ganzhi":"乙巳","zodiac":"Snake (蛇)","leap_month_this_year":6,"month_days":29}`

```
GET https://tttkmbb.com/api/v1/calculate/lunar-calendar-converter?date=2026-09-24
```

## Limitations

You start from a lunar date and need the Gregorian date (use lunar-to-solar), need a person's zodiac with the 立春 boundary option (use chinese-zodiac), or need the astronomical moon phase (use moon-phase). Astronomical computation (Meeus VSOP87 solar longitude, Meeus ch. 49 new moons, Espenak–Meeus ΔT) following the GB/T 33661-2017 rules, checked against Hong Kong Observatory tables; pre-1929 dates use Beijing local mean time as the published calendars did. Traditional calendar/cultural reference calculation; not a prediction, medical, legal or financial advice. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which time zone decides the lunar date?**

New moons and solar terms are evaluated in China Standard Time (UTC+8, 120° E) as the official calendar prescribes; the date you enter is taken as a civil date in that zone. Dates before 1929 use Beijing local mean time (UTC+7:45:40), reproducing the calendars published then.

**Why can the year ganzhi differ between sources?**

Almanacs tied to the lunar calendar switch the year at Chinese New Year (used here); Bazi (八字) practice switches it at 立春. Between the two dates the two conventions give different years; a note flags this when it applies.

**How are month ganzhi assigned?**

By solar-term months: the 寅 month begins at 立春 and each following odd term (惊蛰, 清明 …) starts the next branch; the stem follows the 五虎遁 rule from the year stem.

## Related

- [Lunar to Solar Date Converter](https://tttkmbb.com/lunar/lunar-to-solar.md) — Reverse conversion from a lunar date to the Gregorian date.
- [Chinese Zodiac Calculator (生肖)](https://tttkmbb.com/lunar/chinese-zodiac.md) — Zodiac sign of a birth date with the 立春 boundary option and compatibility tables.
- [Moon Phase Calculator](https://tttkmbb.com/time/moon-phase.md) — Astronomical moon phase and illumination for the same date.
