True Solar Time
v1.0.1True solar time correction for BaZi charts: historical DST, longitude, equation of time.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
true_solar_time True solar time correction
Convert a recorded birth time (wall clock + IANA time zone + longitude) into true solar time — the time a BaZi / Four Pillars chart should actually be cast from. Returns the corrected instant, the total correction decomposed into DST + longitude + equation-of-time (the three always sum exactly), the resulting two-hour branch, distance to the nearest branch boundary, and whether the reported clock time even existed (spring-forward DST gaps, e.g. China 1986–91). Deterministic: same input, same output, every time.
| Parameter | Type | Description |
|---|---|---|
day * | integer | |
hour * | integer | Recorded wall-clock hour, 24h |
longitude * | number | Birthplace longitude in degrees, east positive (Ürümqi ≈ 87.6, Vancouver ≈ -123.1) |
minute * | integer | |
month * | integer | |
timeZone * | string | IANA time zone of the birthplace, e.g. 'Asia/Shanghai', 'America/Vancouver' |
year * | integer | Birth year (Gregorian) |
hour_branch Hour branch of a clock time
Which two-hour branch (子丑寅卯…) a given time falls in, and how many minutes it sits from the nearest branch boundary. Use on an already-corrected time; for raw birth records use true_solar_time.
| Parameter | Type | Description |
|---|---|---|
hour * | integer | |
minute * | integer |