How Is Rokuyo (六曜) Actually Calculated?
One formula, and one hour of clock that decides which lunar calendar it runs on.
Bokki Editorial
The short answer
Rokuyo (六曜) — the six-day cycle of 大安, 赤口, 先勝, 友引, 先負 and 仏滅 that Bokki's home page shows as one of four daily "symbol" cards — comes from a single formula: take the date's lunar month number, add the lunar day, and divide by six; the remainder picks one of the six days in a fixed order. The formula is not in dispute. The input is. Rokuyo belongs to Japan's old lunar calendar (旧暦), and that calendar starts each month on the day of the new moon as it falls on Tokyo's clock. Until September 2026 Bokki read the lunar date from a library that follows China's calendar, which is set one hour earlier, on Beijing's clock. Most months that hour changes nothing. In some it moves the first day of the month, and then every rokuyo in that month comes out wrong.
The formula and today's example
rokuyo.ts turns a solar date into the Japanese lunar date, adds the month and the day, and takes the result mod 6 against a fixed array: 大安 (0), 赤口 (1), 先勝 (2), 友引 (3), 先負 (4), 仏滅 (5). For 24 August 2026 the Japanese lunar calendar reads month 7, day 12: 7 + 12 = 19, and 19 mod 6 = 1, which names 赤口, the day tradition says only noon is favourable. A leap month keeps the number of the month before it, so the leap 5th month of 2017 counts as 5. The library we used to read reports a leap month as a negative number instead, and our old code had to strip that sign with Math.abs(); across 1950–2050, 727 of the 1,080 leap-month days would have come out wrong without it. The new code never sees the sign. And the tests now check the answer against dates printed in a Japanese lunar calendar, not against another program's arithmetic.
One hour, one whole month
The next place the two calendars part is October 2026. The new moon falls on 10 October at 15:50 UTC. In Beijing that is 23:50 on the 10th, so China's 9th month begins on 10 October. In Tokyo it is 00:50 on the 11th, so Japan's 9th month begins on 11 October. Until the next new moon, every date carries a lunar day one smaller in Japan than in China, and because the formula adds the day, every rokuyo in between is different. On 11 October the Japanese calendar reads 9/1: 9 + 1 = 10, and 10 mod 6 = 4, which names 先負, as a Japanese almanac prints it. The old code read China's 9/2: 9 + 2 = 11, and 11 mod 6 = 5, which names 仏滅. The hour can move a leap month too. In 2017 Japan's calendar had a leap 5th month where China's had a leap 6th, and in 2012 Korea's calendar, which runs on the same meridian as Japan's, had a leap 3rd month where China's had a leap 4th (Korea Astronomy and Space Science Institute, 2017).
How often, and why our test could not see it
Across 1950–2050, 36,890 days, the old calculation gave a different rokuyo from the Japanese calendar on 1,319 days, 3.6% of the century. We had tested it. Every one of those days was compared against the library's own built-in rokuyo method, getLiuYao(), and the match was perfect, with zero mismatches. That was true and proved nothing, because getLiuYao() runs on the same Chinese calendar. The agreement showed only that we had copied the library correctly. The tests now bring in something from outside: dates from a published Japanese lunar calendar for October 2026 and June 2017, chosen where the old code and the almanac disagree. They also run our month-and-leap rule on Beijing time and check that it reproduces the library's Chinese calendar on all 51,500 days from 1960 to 2100. The rule is right. What changed is the clock.
What we don't calculate
We compute the rokuyo for a date on the Japanese calendar, and nothing more. Rokuyo has no astronomy of its own, but the lunar date under it does: each month starts at a new moon, which is why the clock matters at all. We don't implement regional variants of the six-day cycle that some sources describe with a different starting offset. For 2033, the year Japan's traditional leap-month rule cannot name the months on its own, we use the leap 11th month that the Korean and Chinese rules both give; some Japanese almanacs may print that year differently. We reframed the traditionally most-feared day, 仏滅, as "a good day to empty out and begin again" rather than a warning (D-003, per PHILOSOPHY). That is a warmth choice layered on top of the calculation, and it doesn't touch which day lands in which slot. And rokuyo only reaches about a quarter of home-page visitors, since it's one of four daily symbol cards chosen by the date.
Closing note — 1,319 wrong days, and a test that agreed with them
In short: rokuyo is (lunar month + lunar day) mod 6, and the lunar date has to be Japan's, set on Tokyo time. Reading China's calendar instead, one hour earlier, gave the wrong rokuyo on 1,319 days between 1950 and 2050, and the next run of them starts on 10 October 2026. Our test compared the result with the same library's own rokuyo method and found nothing, because both sides stood on the same calendar. The check that matters is against the calendar the tradition actually uses, and that is what the tests do now.