What does Almanac Lattices, Jianchu Congruences and Runes conclude, in numbers, about “The Twelve Officers as a Piecewise Congruence, and Which Day Is the Jie Day”?
Answer: Chapter 2 writes the officers as a piecewise congruence that repeats at the twelve jie: a plain cycle is wrong on 336 days, and since Lidong 2027 falls at 23:39 in Beijing but after midnight in Tokyo, almanacs for Tokyo and Los Angeles differ from Beijing's on 1 and 8 days.
Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 2027, 23, 39
| UTC+9 | 1 day differs: 2027-11-07 |
| UTC+7 | 0 days differ |
| UTC-5 | 7 days differ: 2027-02-03, 2027-03-05, 2027-04-04 ... |
| UTC-8 | 8 days differ: 2027-02-03, 2027-03-05, 2027-04-04 ... |
| formula minus NAOJ | -4.5 to -0.8 minutes |
| within an hour of midnight | 2027-11-07 23:39 Beijing |
Key formula
Show the full program
# Chapter 2. p04: Which day is the jie day? The repeat falls on the
# local date of the solar term, so an almanac computed for another time
# zone can differ. Counted: days of 2027 whose officer differs from the
# Beijing (UTC+8) almanac when computed for UTC+9, UTC+7, UTC-5 and
# UTC-8. Also: a low-precision solar formula (Meeus, about 0.01 degree)
# against NAOJ's published times, and jie that fall within an hour of
# midnight in Beijing.
import math
import datetime
OFFICERS = ("jian chu man ping ding zhi po wei cheng shou kai bi").split()
# the 12 "jie" of 2027, Beijing time (UTC+8), from NAOJ's 2027 table
JIE = ((1, 5, 22, 10), (2, 4, 9, 46), (3, 6, 3, 40), (4, 5, 8, 17),
(5, 6, 1, 25), (6, 6, 5, 26), (7, 7, 15, 37), (8, 8, 1, 27),
(9, 8, 4, 28), (10, 8, 20, 17), (11, 7, 23, 39), (12, 7, 16, 38))
D0 = datetime.date(2027, 1, 1) # geng-chen day, mansion Gui (22)
def days(offset_h=0):
"""One dict per day of 2027: stem, branch, month and year branch."""
jie = [datetime.datetime(2027, m, d, h, mi) +
datetime.timedelta(hours=offset_h) for m, d, h, mi in JIE]
out = []
for k in range(365):
day = D0 + datetime.timedelta(days=k)
n = sum(1 for j in jie if j.date() <= day) # jie passed
gz = (16 + k) % 60
out.append({"date": day, "gz": gz, "s": gz % 10, "b": gz % 12,
"M": n % 12, "Y": 6 if n < 2 else 7,
"mansion": (22 + k) % 28})
return out
LON = (285, 315, 345, 15, 45, 75, 105, 135, 165, 195, 225, 255)
def sun_lon(jde):
T = (jde - 2451545.0) / 36525
L0 = 280.46646 + 36000.76983 * T + 0.0003032 * T * T
M = math.radians(357.52911 + 35999.05029 * T - 0.0001537 * T * T)
C = ((1.914602 - 0.004817 * T - 0.000014 * T * T) * math.sin(M) +
(0.019993 - 0.000101 * T) * math.sin(2 * M) +
0.000289 * math.sin(3 * M))
om = math.radians(125.04 - 1934.136 * T)
return (L0 + C - 0.00569 - 0.00478 * math.sin(om)) % 360
def jie_formula(k):
"""Beijing time of the k-th jie of 2027 by the formula (Delta T 69 s)."""
t0 = datetime.datetime(2027, JIE[k][0], JIE[k][1], 12)
jd = 2461406.5 + (t0 - datetime.datetime(2027, 1, 1)).total_seconds() \
/ 86400 - 8 / 24
for _ in range(40):
jd += ((LON[k] - sun_lon(jd + 69 / 86400) + 180) % 360 - 180) \
/ 0.9856
return datetime.datetime(2027, 1, 1) + datetime.timedelta(
days=jd - 2461406.5 + 8 / 24)
if __name__ == "__main__":
base = [(d["b"] - d["M"]) % 12 for d in days()]
for name, off in (("UTC+9", 1), ("UTC+7", -1), ("UTC-5", -13),
("UTC-8", -16)):
o = [(d["b"] - d["M"]) % 12 for d in days(off)]
diff = [days()[k]["date"].isoformat() for k in range(365)
if o[k] != base[k]]
word = "day differs" if len(diff) == 1 else "days differ"
shown = ", ".join(diff[:3]) + (" ..." if len(diff) > 3 else "")
print(" {}: {} {}{}".format(
name, len(diff), word, (": " + shown) if diff else ""))
err = []
for k, (m, d, h, mi) in enumerate(JIE):
pub = datetime.datetime(2027, m, d, h, mi)
err.append((jie_formula(k) - pub).total_seconds() / 60)
print(" formula minus NAOJ: {:.1f} to {:.1f} minutes".format(
min(err), max(err)))
for m, d, h, mi in JIE:
if h == 23 or h == 0:
print(" within an hour of midnight: 2027-{:02d}-{:02d} "
"{:02d}:{:02d} Beijing".format(m, d, h, mi))Single source and citation
Fan, Y. (2026). Almanac Auspicious Boolean Lattices, Jianchu Twelve-Officer Congruences and Runic Combinatorics (Version 1.0.0), Chapter 2: The Twelve Officers as a Piecewise Congruence, and Which Day Is the Jie Day. 5D Library. https://doi.org/10.5281/zenodo.24090239
DOI: 10.5281/zenodo.24090239 · Read the monograph · 5DL-B-091 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026091,
author = {Fan, Yafu},
title = {Almanac Auspicious Boolean Lattices, Jianchu Twelve-Officer Congruences and Runic Combinatorics},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090239},
url = {https://doi.org/10.5281/zenodo.24090239}
}Other chapter answers in this book
- Chapter 1 · Almanac Rules as Boolean Predicates, and the Vanishing Pure Day
- Chapter 3 · Joint Periods: Stem-Branch Days, the Twenty-Eight Lodges and the Week
- Chapter 4 · Satisfiability: When No Day Is Acceptable, and When Every Day Is Both
- Chapter 5 · Reversed Runes: A Hypergeometric-Binomial Law
- Chapter 6 · What a Reversal Can Say, and How Much the Rune Set Matters
- Chapter 7 · The Shuihudi Daybooks, the Qing Imperial Compilation on Day Selection, and the Runes of Havamal
- Chapter 8 · Auditing an Almanac App and a Pre-Registered Test