<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hengwen Pu</title>
    <description>The latest articles on DEV Community by Hengwen Pu (@hengwenpu).</description>
    <link>https://dev.to/hengwenpu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4247979%2Ff6a99e4f-1075-4707-9027-3848dc5dfb0a.png</url>
      <title>DEV Community: Hengwen Pu</title>
      <link>https://dev.to/hengwenpu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hengwenpu"/>
    <language>en</language>
    <item>
      <title>Your Chinese zodiac sign might be wrong — here's the open boundary dataset (1924–2043)</title>
      <dc:creator>Hengwen Pu</dc:creator>
      <pubDate>Mon, 16 Nov 2026 15:08:53 +0000</pubDate>
      <link>https://dev.to/hengwenpu/your-chinese-zodiac-sign-might-be-wrong-heres-the-open-boundary-dataset-1924-2043-2i29</link>
      <guid>https://dev.to/hengwenpu/your-chinese-zodiac-sign-might-be-wrong-heres-the-open-boundary-dataset-1924-2043-2i29</guid>
      <description>&lt;p&gt;If you were born in late January or the first half of February, there is a real chance the animal on your paperwork is not your animal in the traditional count. Not because of anything mysterious — because two different calendars are used to answer the question "when does the zodiac year change", and they disagree for a window of up to three weeks every single year.&lt;/p&gt;

&lt;p&gt;We needed the exact answer for every year between 1924 and 2043, couldn't find it as clean data, computed it, and open-sourced it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/hengwenpu/chinese-zodiac-year-boundary" rel="noopener noreferrer"&gt;github.com/hengwenpu/chinese-zodiac-year-boundary&lt;/a&gt;&lt;/strong&gt; — MIT licensed, two CSV files, one zero-dependency Node.js lookup helper.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two calendars, one zodiac
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Convention&lt;/th&gt;
&lt;th&gt;Year switches at&lt;/th&gt;
&lt;th&gt;Used by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Lichun (立春)&lt;/strong&gt; — the sun reaches celestial longitude 315°&lt;/td&gt;
&lt;td&gt;~Feb 3–5, varying by year&lt;/td&gt;
&lt;td&gt;The ganzhi (干支) calendar, BaZi / Four Pillars, traditional almanacs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lunar New Year (正月初一)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The lunar calendar, Jan 21–Feb 20&lt;/td&gt;
&lt;td&gt;The civil lunar calendar; the Chinese national standard GB/T 33661-2017 defines the zodiac year of the lunar calendar this way&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both are internally consistent. Both are "correct". They just answer different questions — and anyone born between the two dates gets a different animal depending on which one you ask. Roughly one person in twelve is affected.&lt;/p&gt;

&lt;p&gt;1996 is a vivid example: Lichun fell on &lt;strong&gt;February 4&lt;/strong&gt;, Lunar New Year on &lt;strong&gt;February 19&lt;/strong&gt;. Someone born on February 18, 1996 is a &lt;strong&gt;Rat&lt;/strong&gt; in the ganzhi count and would be counted an &lt;strong&gt;Ox&lt;/strong&gt; (or Pig, depending on the year) by a calculator that keys off Lunar New Year. Fifteen days of disagreement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is an engineering problem
&lt;/h2&gt;

&lt;p&gt;Most zodiac calculators on the internet use one of three shortcuts: January 1 (wrong), a fixed "February 4" (wrong — the date wobbles between Feb 3 and 5), or Lunar New Year (valid for the civil calendar, wrong for anything ganzhi-related).&lt;/p&gt;

&lt;p&gt;For casual use, that's a shrug. But if you compute BaZi / Four Pillars charts, the year pillar comes from the Lichun boundary — get the boundary wrong and the year pillar is wrong, which propagates into every derived pillar. There is no fuzzy match; a date is on one side of the line or the other.&lt;/p&gt;

&lt;h2&gt;
  
  
  The astronomy, in one paragraph
&lt;/h2&gt;

&lt;p&gt;Lichun is the moment the sun's apparent geocentric longitude crosses 315°. Because Earth's orbit is elliptical and its speed varies (Kepler's second law), the instant drifts by minutes year to year, and the &lt;em&gt;date&lt;/em&gt; lands on February 3, 4, or 5 depending on leap-year rhythms and where you are on the orbit. In 2026 the instant is February 4, 04:01 Beijing time. In 2024 it was February 4, 16:27. Same day both years, but not the same day every year — and not the same day in every decade.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's in the repo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;data/zodiac-years-1924-2043.csv&lt;/code&gt;&lt;/strong&gt; — one row per ganzhi year, two full 60-year cycles, contiguous by construction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ganzhi_year,ganzhi,ganzhi_cn,animal,animal_cn,starts_lichun,ends_next_lichun
1924,Jia-Zi,甲子,Rat,鼠,1924-02-05,1925-02-04
1925,Yi-Chou,乙丑,Ox,牛,1925-02-04,1926-02-04
2026,Bing-Wu,丙午,Horse,马,2026-02-04,2027-02-04
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;data/lichun-1900-2100.csv&lt;/code&gt;&lt;/strong&gt; — every Lichun instant from 1900 to 2100, with an approximate Beijing-time clock reading and a &lt;code&gt;near_midnight&lt;/code&gt; flag for the only cases where minute-level accuracy could ever change the date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;index.js&lt;/code&gt;&lt;/strong&gt; — a zero-dependency lookup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;zodiac&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'chinese-zodiac-year-boundary'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;zodiac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;animalFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-02-03'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Snake — still the Snake year&lt;/span&gt;
&lt;span class="n"&gt;zodiac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;animalFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'2026-02-05'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Horse — the Horse year began at Lichun, Feb 4&lt;/span&gt;
&lt;span class="n"&gt;zodiac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;animalFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'1996-02-18'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Rat — even though Lunar New Year 1996 fell on Feb 19&lt;/span&gt;
&lt;span class="n"&gt;zodiac&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;yearInfo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1984&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;           &lt;span class="c1"&gt;// { ganzhi: 'Jia-Zi', animal: 'Rat', startsOn: '1984-02-04', ... }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A birth &lt;strong&gt;on&lt;/strong&gt; the Lichun date itself counts toward the new year; if you need to split that day, the approximate instant is in the Lichun CSV. Dates outside 1924–2043 return &lt;code&gt;null&lt;/code&gt; rather than a guess.&lt;/p&gt;

&lt;h2&gt;
  
  
  Accuracy, stated honestly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Day-level dates are the claim of this dataset.&lt;/strong&gt; They were computed from the sun's apparent longitude and spot-checked against published values from the Purple Mountain Observatory (紫金山天文台) — including 2024-02-04 16:27 and 2026-02-04 04:01 — with no date-level discrepancies, including the two years in the range closest to midnight (2046, 2050).&lt;/li&gt;
&lt;li&gt;The minute column is &lt;strong&gt;approximate&lt;/strong&gt; and may differ from the observatory's official instant by up to about 7 minutes. Do not build anything on the minutes. That's exactly why &lt;code&gt;near_midnight&lt;/code&gt; exists — it flags the only rows where that gap could ever touch the date, so you know where to double-check.&lt;/li&gt;
&lt;li&gt;Corrections with an authoritative source are welcome as pull requests.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Which convention should &lt;em&gt;you&lt;/em&gt; use?
&lt;/h2&gt;

&lt;p&gt;Whichever one matches your product's claim:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Serving the &lt;strong&gt;civil/lunar calendar&lt;/strong&gt; view (what most people mean by "Chinese New Year")? Use the Lunar New Year boundary. GB/T 33661-2017 legislates it for the civil calendar, and it is the right answer &lt;em&gt;for that calendar&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Serving &lt;strong&gt;ganzhi, BaZi, almanac, or solar-term&lt;/strong&gt; contexts? Use Lichun. That's the boundary those systems actually run on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We publish on the Lichun convention because that's what our own charts are computed on. The point of the dataset is not that one convention wins — it's that the two are different, and the difference is knowable in advance, for every year, down to the day.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we built it
&lt;/h2&gt;

&lt;p&gt;We're &lt;a href="https://tool.yushucarp.com" rel="noopener noreferrer"&gt;Xuanji (璇玑)&lt;/a&gt; — we compute BaZi charts from true solar time and publish the boundaries our own engine runs on, because a chart you can't audit isn't worth much. We also make physical zodiac cards with printed reports (&lt;a href="https://www.yushucarp.com" rel="noopener noreferrer"&gt;yushucarp.com&lt;/a&gt;) — that's the commercial interest, disclosed. The free chart tool requires no signup: &lt;strong&gt;&lt;a href="https://tool.yushucarp.com" rel="noopener noreferrer"&gt;tool.yushucarp.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The dataset is MIT — use it, ship it, cite it. A link back is appreciated but not required. If you find a date that disagrees with an authoritative source, open a PR; that's the whole point of publishing it.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>data</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
