Computed from the real lunisolar calendar and the exact solar terms, so it is right for the six or seven weeks each year when a lookup table is wrong, and right to the hour for the Four Pillars.
Try 30 January 1990, or any date in early February — that is where the two systems part company. Or 4 February 2024 either side of 16:27 in Beijing.
The zodiac year does not begin on 1 January. The popular zodiac rolls over at Lunar New Year (late January to mid February). BaZi and Four Pillars roll over at Lichun, the start of spring, around 3–5 February, at an exact moment. Every January birthday belongs to the previous animal year, and where the two boundaries differ, both answers are shown rather than one picked silently. On Lichun day itself, and for the hour pillar, only the birth time can decide.
New moons, the December solstice and the solar terms come from Astronomy Engine. Lunar New Year follows the calendar rules (month 11 holds the solstice; a leap month is the first with no principal term), in China time. Year pillar turns at Lichun, month pillar at each of the twelve jie terms, day pillar at local midnight, hour pillar every two hours from 23:00. From 23:00 to midnight the hour stem follows the next day (the common “late Rat hour” rule). Birth time is taken in local standard time: if the clocks were on daylight saving, that hour is removed first. No correction to true solar time. Checked against an independent calendar library for every Lunar New Year 1901–2099 and 580 sample births.