convert_calendar
Convert dates between Solar and Lunar calendars. Essential for translating Solar periods to Lunar for Tu Vi transit calculations.
Instructions
Convert a date between the Solar (Dương lịch) and Lunar (Âm lịch) calendars.
Purpose and Comparison
Use this tool to translate dates back and forth between Solar and Lunar systems.
CRITICAL FOR TRANSIT ASSESSMENTS: Since Tu Vi transit calculations (sao lưu, Đại Hạn, Tiểu Hạn, Nguyệt Hạn) operate strictly on the Lunar calendar, you MUST convert any Solar target periods (e.g. "October 2026") using this tool before calling
get_van_han.Do NOT use this tool if you only need base chart calculation, as chart generation tools (
generate_horoscopeandget_saved_horoscope) already handle birth date conversions internally.
Side Effects, Auth, and Rate Limits
Side Effects: None. This is a pure mathematical calculation.
Auth/Rate Limits: Runs entirely locally. No authentication or external rate limits apply.
Prerequisites
The date to convert must represent a valid Gregorian or Chinese Lunar date within calendar ranges (typically 1900-2100).
Parameter Guidelines & Interactions
day: Day of the date to convert (1-31).month: Month of the date to convert (1-12).year: Year of the date to convert (four-digit year).from_solar: IfTrue(default), converts Solar to Lunar. IfFalse, converts Lunar to Solar.lunar_leap: Only applicable whenfrom_solar=False. Set toTrueif the source Lunar month is a leap month (tháng nhuận); otherwiseFalse.timezone: Timezone offset (default: 7, matching Vietnam/ICT).
Output Schema and Error Conditions
Returns: A dictionary containing:
day: Converted day (int).month: Converted month (int).year: Converted year (int).leap: Boolean indicating if the Lunar month is a leap month.
Errors: Returns
{"error": "error_message"}if date arguments are out of bounds or fail calendar validation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | Yes | ||
| year | Yes | ||
| month | Yes | ||
| timezone | No | ||
| from_solar | No | ||
| lunar_leap | No |