jyotishya

BaZi (Four Pillars): the calendar calculation

Definition

BaZi (eight characters) represents a birth moment as four pillars, year, month, day and hour, each a pair of one heavenly stem (10) and one earthly branch (12). It uses the solar calendar, not planetary positions: the only astronomical input is the Sun's longitude, which sets the year and month boundaries.

Where the method comes from

The 60-term cycle counts days on the late-Shang oracle bones (about 1250 to 1200 BCE). Years were named by it from the Han. Taking the day stem as the person (the Day Master) and adding the hour is Song or later, ascribed to Xu Ziping (10th century) and written down by Xu Dasheng (late Southern Song), two different people. When Lichun became the year boundary is not documented in the sources we found. The history of BaZi note has the details.

The stems and branches

Reference data, as the tradition assigns it; Jyotishya draws no meaning from it. The ten stems, index 0 to 9: Jia (yang Wood), Yi (yin Wood), Bing (yang Fire), Ding (yin Fire), Wu (yang Earth), Ji (yin Earth), Geng (yang Metal), Xin (yin Metal), Ren (yang Water), Gui (yin Water).

The twelve branches, index 0 to 11: Zi (Rat, Water), Chou (Ox, Earth), Yin (Tiger, Wood), Mao (Rabbit, Wood), Chen (Dragon, Earth), Si (Snake, Fire), Wu (Horse, Fire), Wei (Goat, Earth), Shen (Monkey, Metal), You (Rooster, Metal), Xu (Dog, Earth), Hai (Pig, Water).

Year and month

The year changes at Lichun, when the Sun reaches 315° tropical longitude (about 4 February). Year stem = (year − 4) mod 10; year branch = (year − 4) mod 12. Months change at each jie solar term (Sun at 315°, 345°, 15° …). Month index m = floor(((Sun longitude − 315) mod 360) ÷ 30); month branch = (2 + m) mod 12; month stem = ((year stem mod 5) × 2 + 2 + m) mod 10.

Day and hour

Day pillar index = (Julian Day Number + 49) mod 60; stem = index mod 10, branch = index mod 12 (index 0 is Jia Zi). Check: 1 October 1949 gives Jia Zi; 1 January 2000 gives Wu Wu. Day and hour use local mean solar time, UTC + longitude ÷ 15 hours (east positive). Hour branch = floor((local mean solar hour + 1) ÷ 2) mod 12, so Zi runs 23:00 to 01:00; hour stem = ((day stem mod 5) × 2 + hour branch) mod 10, using the next day's stem from 23:00 (see below).

Four pillars for 1 January 2000, 12:00 at GreenwichFour columns, hour, day, month and year, each a heavenly stem above an earthly branch: hour Wu Wu, day Wu Wu, month Bing Zi, year Ji Mao. The day stem is the Day Master.HourWuYang EarthWuHorse, FireDayWuYang EarthWuHorse, FireMonthBingYang FireZiRat, WaterYearJiYin EarthMaoRabbit, WoodstembranchDay Master: the day stem (outlined). 1 January 2000 is a Wu Wu day.
The four pillars for the check date in the text, calculated by the same code as the app.

A second example: just before Lichun

Beijing (116.4° E), 3 February 2025, 21:05 China Standard Time = 13:05 UTC. Lichun fell at 14:10 UTC that day.

Year: the Sun is at 314.95°, so the year is still 2024: (2024 − 4) mod 10 = 0, mod 12 = 4, Jia Chen. Month: (314.95 − 315) mod 360 = 359.95, m = floor(359.95 ÷ 30) = 11; branch (2 + 11) mod 12 = 1, stem (0 + 2 + 11) mod 10 = 3, Ding Chou.

Day: local mean solar time = 13:05 + 116.4 ÷ 15 h = 20:51. Julian Day Number 2460710; (2460710 + 49) mod 60 = 39, Gui Mao. Hour: floor((20.84 + 1) ÷ 2) = 10, Xu; stem ((9 mod 5) × 2 + 10) mod 10 = 8, Ren Xu.

By the clock, 21:05 would fall in the Hai hour (Gui Hai). At 22:30, after Lichun, the year is Yi Si and the month Wu Yin; the day stays Gui Mao, as it changes only at midnight.

Checking it by hand

A 10,000-year calendar or almanac lists each date's year, month and day pillars; for 1 January 2000 one gives Ji Mao (before Lichun, so 1999's year), Bing Zi, Wu Wu, as the formulas do. Then: near a jie term, compare with the term's exact time; convert clock time to UTC (daylight saving included) and add longitude ÷ 15 hours, 4 minutes per degree; take the day and hour from that time. Jyotishya does not add the equation of time.

Where software and schools differ

Day boundary: the whole day changes at 23:00; or at midnight, with 23:00 to midnight taking the next day's hour stem (split Zi); or at midnight, with that hour keeping the ending day's stem. For 23:30 local mean solar time on 28 July 1928 these give Geng Wu day and Bing Zi hour, Ji Si and Bing Zi, or Ji Si and Jia Zi. Jyotishya uses split Zi.

Time: clock, local mean solar, or true solar time, which adds the equation of time (about −16 to +14 minutes). Year: everyday counting changes at the lunar new year, fate calculation at Lichun. Elements: most software also counts hidden stems; Jyotishya counts main elements only, outside any score. Common slips: the lunar new year, clock time, and forgetting daylight saving.

Day Master and elements

The day stem is called the Day Master. Production runs Wood → Fire → Earth → Metal → Water → Wood; control runs Wood → Earth → Water → Fire → Metal → Wood. Relative to the Day Master: what produces it is resource, what controls it pressure, what it controls wealth, what it produces output, the same element companion.

In Jyotishya

Each day's pillar is the one for your local calendar date. Day stem's element against the Day Master: resource or wealth +1, pressure −1, companion or output 0. Day branch against your natal day branch: clash (six apart) −1, six-harmony (Zi–Chou, Yin–Hai, Mao–Xu, Chen–You, Si–Shen, Wu–Wei) +1. Day branch against your natal year branch: clash −1. It deliberately ignores Day Master strength, which classical practice treats as essential. No classical BaZi text we found scores a person's day; this score is Jyotishya's construction, and each day's Why? says so.

Sources

Related