Method · verification
24 reproducible test vectors
Every rule in spec v1.0.0 has a case you can run yourself.
Engine spec v1.0.0 · 24 golden vectors · 12 independently cross-checkable against lunar_python 1.4.9 (all agree).
What the vectors cover
- Standard dates across seasons, 立春 boundaries and month 节 boundaries
- 23:00 day change and the documented late 子时 stem divergence
- Historical daylight-saving transitions and ambiguous (fold) local times
- True-solar-time correction across longitudes, including a 2h36m spread between Urumqi (87.6168E) and Harbin (126.6424E)
- Chinese lunar dates as an input format, leap months, and fail-closed rejection of a leap month that does not exist in that year
- Rejection of an invalid lunar day (for example a 30th day in a 29-day lunar month)
A rule worth knowing
The first six vectors (click to expand)
| # | Input | Year | Month | Day | Hour |
|---|---|---|---|---|---|
| 1 | 1990-04-15 10:00 Asia/Shanghai | 庚午 | 庚辰 | 辛丑 | 癸巳 |
| 2 | 1988-02-17 23:30 Asia/Shanghai | 戊辰 | 甲寅 | 甲子 | 丙子 |
| 3 | 2000-01-01 00:30 Asia/Tokyo | 己卯 | 丙子 | 戊午 | 壬子 |
| 4 | 1975-08-21 14:00 America/Los_Angeles | 乙卯 | 甲申 | 己丑 | 辛未 |
| 5 | 2003-12-31 23:59 Asia/Shanghai | 癸未 | 甲子 | 甲子 | 甲子 |
| 6 | 1965-06-15 05:30 Europe/London | 乙巳 | 壬午 | 庚子 | 己卯 |
Full readable version: Method.
The complete machine-runnable test file is
published with the specification. Run
python verify.py to check all 24 vectors, or
python verify.py --crosscheck to also compare the 12
cross-checkable vectors against lunar_python 1.4.9.
For self-reflection and entertainment only. Not a prediction, and not advice about health, money, relationships or career.