I met Kip Cole at the Melbourne Elixir meetup where he shared about his work on Tempo and I thought the design and idea there were really appealing and would be a good fit for Roc -- I decided to try it out... and now I would like to share my latest package with the community.
roc-time is for working with time the ways humans actually think about it, as a bounded span on a timeline and not as a scalar instant.
import time.ExactInterval
import time.Coverage
opening = "2026-06-15T09:00:00Z/2026-06-15T17:00:00Z"
booking = "2026-06-15T12:00:00+02:00/2026-06-15T14:00:00+02:00"
busy = Coverage.from_spans([ExactInterval.span(booking)])
free_windows = Coverage.complement_within(busy, ExactInterval.span(opening))
I would say the package is already quite useful for many use cases; though there is still a lot more on the roadmap.
I've been getting distracted with fuzz testing, setting up oracles, and generally messing around with benchmarks or profiling Roc for a bit of fun. There isn't really an accepted benchmark for time projects that I could find, so I combined ideas from various places and made my own simple one for comparison.
Here are some results from a recent run on my machine;
| Library | Parse + POSIX conversion (ns/op) | Add 17 calendar days (ns/op) |
|---|---|---|
| roc-time | 40.5 | 11.9 |
| Rust Chrono | 19.5 | 3.9 |
| Rust Jiff | 29.9 | 7.2 |
| Go time | 46.0 | 18.9 |
| Python datetime | 377.7 | 123.9 |
roc-time is roughly slower than Rust's chrono and jiff, about the same as Go's time, and faster than Python's datetime.
Thanks for releasing it! Does roc-time plan to encompass all your time-based needs? Just reading the docs for Tempo, it advises to reach for the stdlib instead when you don't need all the span related gizmos and can live within a bubble of local time etc. (and to use an agent if I do want to use Tempo :thinking:). I just need something for formatting / parsing 8601 or 3339 style date strings, so I guess thats in OffsetTimestamp?
Edit: I suppose this is better restated as: roc-time/Tempo expose the gory details of working with time, but for simple use cases where time-based footguns apply less, the api is quite involved, but the name suggests it is general purpose.
My understanding is that it should cover most of your needs, similar to Rust's chrono
But its new to me too, so I'm still learning a lot about it all. If you run into any friction or gaps I'm keen to know about those.
Last updated: Sep 24 2026 at 15:59 UTC