Time-Compute is a library compatible with the Chrono API, featuring additional functions.
⚓ Rust 📅 2026-07-14 👤 surdeus 👁️ 1Hello,
I have just released Time-Compute, a Rust library for date and time calculations. Its API is identical to that of chrono—sharing the same types, method names, and behavior—yet the codebase has absolutely no connection to chrono.
Not a single line of code was copied, nor were any algorithms adapted. The API resemblance exists for one reason only: to allow a project already built on chrono to migrate simply by changing use chrono::... to use time_compute::..., without needing to rewrite anything else.
Why recreate what chrono already does?
It all started with a simple observation: unlike most areas of software development, calendar calculation is a mathematically settled problem. Once a function is verified as correct (against a published table of holidays, an astronomical reference, or an independent implementation), it remains correct forever. What changes over time is never the domain logic itself, but only the surrounding ecosystem (Rust versions, dependencies). This changes the long-term meaning of "maintaining" this type of library. Beyond the core logic compatible with the chrono crate, time_compute includes calculations that chrono lacks entirely:
Christian movable feasts (Western and Orthodox Easter, Mardi Gras, Ascension, Pentecost, etc.)
Full Hebrew calendar (bidirectional conversion, Passover, Rosh Hashanah, Hanukkah, Purim, etc.)
Tabular Hijri calendar (Ramadan, Eid al-Fitr, Eid al-Adha)
Japanese era system, fixed holidays, and holidays based on actual astronomical calculations (equinoxes)
Chinese lunisolar calendar (New Year, Dragon Boat Festival, Mid-Autumn Festival, etc.)
Thai Buddhist calendar (Magha/Visakha/Asalha Bucha, etc.)
Matariki (Māori New Year), an official public holiday in New Zealand
How it is tested:
Two independent layers: 492 unit tests verified against external sources (published tables, astronomical references, independent implementations), and—during development—a differential test harness that directly compared the outputs of time_compute and chrono, input by input, across tens of thousands of cases.
Where to find Time-Compute:
Code: https://github.com/Fab2bprog/Time-Compute
crates.io: time_compute
Full documentation is included.
1 post - 1 participant
🏷️ Rust_feed