Paired Calendar Versioning

MoonVer

Day and time are instantly readable. Year and month require a quick ÷12 — like counting lunar cycles. Minute-level precision with 40 years of range.

Formula

group = ⌊(year − 2025) ÷ 2⌋
half  = (year − 2025) mod 2  // 0 or 1

X = group × 12 + month  // 1–252
Y = half × 100 + day  // 1–131
Z = hour × 100 + minute  // 0–2359
X
1 – 252
Group + Month
Y
1 – 131
Half + Day
Z
0 – 2359
HHmm

The paired-year trick

Years are grouped in pairs. The first year of each pair has Y = day (1–31). The second year has Y = 100 + day (101–131). This doubles the effective year range without breaking sort order, because 101 > 31 within the same X.

Y = 17  → first year of the pair, day 17
Y = 117 → second year of the pair, day 17

To decode X: divide by 12. The quotient is the group (each group = 2 years), the remainder is the month. Total year = 2025 + group × 2 + half.

Examples

DatetimeVersionHow to decode
2025-01-01 00:001.1.01÷12 = g0 r1 → Jan 2025, day 1, 00:00
2025-04-17 08:304.17.8304÷12 = g0 r4 → Apr 2025, day 17, 08:30
2026-04-17 08:304.117.830g0 r4 → Apr, Y=117 → +1 yr → 2026, day 17
2026-12-31 23:5912.131.2359g0 r12 → Dec, Y=131 → 2026, day 31
2030-06-15 12:0036.115.120036÷12 = g3 r0… wait: g2 r12 → Dec? No:
2030-06-15 12:0036.115.120036÷12 = g3 r0 → but r0 isn't a month…
Edge case: When month = 12, X = group × 12 + 12, which means X ÷ 12 gives (group+1) remainder 0. The decoder must treat remainder 0 as month 12 of the previous group. This is handled in the converter below.
DatetimeVersionDecoded
2025-01-01 00:001.1.02025-01-01 00:00
2025-04-17 08:304.17.8302025-04-17 08:30
2026-04-17 08:304.117.8302026-04-17 08:30
2027-07-04 14:0019.4.14002027-07-04 14:00
2030-06-15 12:0036.115.12002030-06-15 12:00
2033-08-20 12:0056.20.12002033-08-20 12:00
2050-12-31 23:59168.131.23592050-12-31 23:59
2065-06-15 09:00246.15.9002065-06-15 09:00

Converter

Properties

Monotonic sorting. The paired-year trick preserves sort order. Within the same X, the second year (Y ≥ 101) always sorts above the first year (Y ≤ 31). Across different X values, X itself is monotonically increasing.
40-year range. Group max = 20 (X = 20×12+12 = 252 ≤ 255). With paired years: 21 groups × 2 = 42 years → through 2065. (Group 20 only reaches month 3 at X = 20×12+3 = 243, but paired gives 2065-03.)
Minute resolution. Z = HHmm directly, so every minute is distinguishable. Suitable for CI pipelines with frequent builds.

When to use MoonVer

MoonVer is the middle ground: day and time are readable at a glance (Y and Z), and the ÷12 on X is the only mental math needed. It offers minute-level precision for CI-heavy teams while keeping versions human-friendly enough for changelogs.