# Lunar to Solar Date Converter

> Converts a Chinese lunar calendar date (year, month, leap-month flag, day) to the Gregorian date, reporting the weekday, the day's ganzhi (干支) and the length of that lunar month, and validating that the leap month and day exist in that year.

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

## Purpose

Converts a Chinese lunar calendar date (year, month, leap-month flag, day) to the Gregorian date, reporting the weekday, the day's ganzhi (干支) and the length of that lunar month, and validating that the leap month and day exist in that year.

**Use when:** You know a lunar date such as 八月十五 or 闰六月初一 of a given lunar year and need the Gregorian date (e.g. for a lunar birthday or festival).

**Do not use when:** You start from a Gregorian date (use lunar-calendar-converter), or you want every festival of a year at once (use chinese-festivals).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `lunar_year` | integer |  | required | Lunar year number (the year that starts at that year's Chinese New Year), 1900–2100. (min 1900, max 2100) |
| `lunar_month` | integer |  | required | Lunar month number 1 (正月) to 12 (腊月). (min 1, max 12) |
| `is_leap_month` | boolean |  | optional, default false | true when the date is in the intercalary month of that number (only valid in years that have that leap month). |
| `lunar_day` | integer |  | required | Day of the lunar month, 1–30 (day 30 exists only in 30-day months). (min 1, max 30) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `gregorian_date` | date |  | Gregorian civil date (China Standard Time). |
| `weekday` | string |  | Day of the week. |
| `day_ganzhi` | string |  | Sexagenary day with pinyin, e.g. 壬寅 (Renyin). |
| `month_days` | integer |  | Length of the requested lunar month (29 or 30). |
| `lunar_date_chinese` | string |  | Written form, e.g. 二〇二六年八月十五. |
| `month_name` | string |  | Traditional month name, prefixed 闰 for a leap month. |
| `year_ganzhi` | string |  | Sexagenary year with pinyin, e.g. 丙午 (Bingwu). |
| `zodiac` | string |  | Zodiac animal of the lunar year. |
| `julian_day_number` | integer |  | Julian Day Number of the Gregorian date. |
| `leap_month_note` | string |  | Which leap month the lunar year has (if any), so a wrong is_leap_month flag can be corrected. |

## Formula

`JDN = start of the lunar month (new-moon day at UTC+8) + lunar_day − 1; month numbering per GB/T 33661-2017 (month 11 contains the winter solstice; leap month = first month without a 中气)`

Same astronomical calendar core as lunar-calendar-converter, checked against Hong Kong Observatory tables. A leap month that does not exist in the year raises INVALID_PARAMETER; a day beyond the month length raises OUT_OF_RANGE. 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)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/lunar-to-solar?lunar_year=…&lunar_month=…&lunar_day=…`
- `POST https://tttkmbb.com/api/v1/calculate/lunar-to-solar` 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-to-solar · OpenAPI operationId `convert_lunar_to_solar` 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:  `run_calculator` with `{"calculator_id": "lunar-to-solar", "inputs": {…}}`

## Example

- 2026 八月十五 (Mid-Autumn Festival): inputs `{"lunar_year":2026,"lunar_month":8,"is_leap_month":false,"lunar_day":15}` → `{"gregorian_date":"2026-09-25","weekday":"Friday","month_days":29,"lunar_date_chinese":"二〇二六年八月十五","year_ganzhi":"丙午 (Bingwu)"}`
- 2025 闰六月初一: inputs `{"lunar_year":2025,"lunar_month":6,"is_leap_month":true,"lunar_day":1}` → `{"gregorian_date":"2025-07-25","weekday":"Friday","month_days":29,"month_name":"闰六月"}`

```
GET https://tttkmbb.com/api/v1/calculate/lunar-to-solar?lunar_year=2026&lunar_month=8&is_leap_month=false&lunar_day=15
```

## Limitations

You start from a Gregorian date (use lunar-calendar-converter), or you want every festival of a year at once (use chinese-festivals). Same astronomical calendar core as lunar-calendar-converter, checked against Hong Kong Observatory tables. A leap month that does not exist in the year raises INVALID_PARAMETER; a day beyond the month length raises OUT_OF_RANGE. 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

**What if I set is_leap_month for a year without that leap month?**

The conversion is rejected with INVALID_PARAMETER and the hint names the leap month that year actually has (for example 2033 has 闰十一月, starting 2033-12-22) or states that the year has none.

**Which year is 'lunar year 2025'?**

The year that begins at Chinese New Year 2025-01-29 and ends 2026-02-16; its 腊月 (12th month) therefore falls in January–February 2026 of the Gregorian calendar.

## Related

- [Lunar Calendar Converter (农历)](https://tttkmbb.com/lunar/lunar-calendar-converter.md) — Gregorian to lunar conversion with solar terms and festivals.
- [Day of the Week Calculator](https://tttkmbb.com/everyday/day-of-week.md) — Weekday details for the resulting Gregorian date.
- [Chinese Festival Dates Calculator](https://tttkmbb.com/lunar/chinese-festivals.md) — Gregorian dates of all traditional festivals in a year.
