github.com/daypack-dev/timere ↗
OCaml date time handling and reasoning suite
Open this visualization on its own page →
Contributors
3
Lines of Code
2,471
From
2020-11-11
To
2021-01-08
About daypack-dev/timere
Timere is a comprehensive OCaml suite for handling and reasoning about dates, times, and timezones. The project consists of three main components: Timedesc for date and time handling, Timere for temporal reasoning and interval logic, and Timere-parse for natural language parsing of dates and durations. The library includes a built-in subset of the IANA timezone database (covering 1970-2040) and supports multiple calendar systems including Gregorian, ISO week, and ISO ordinal dates with nanosecond precision.
Timedesc provides robust datetime functionality including ISO8601 parsing, RFC3339 printing, and HTTP date format support, while Timere enables sophisticated temporal operations like pattern matching across daylight saving time boundaries, interval intersection and union, and timezone-aware time range evaluation. For example, users can easily find all Christmases falling on Wednesday or compute the intersection of business hours between different timezones. The library is designed with flexibility in mind, offering pluggable backends for both timezone data sources and local timezone detection, allowing developers to embed the full database or load it at runtime as needed.
The project is built with OCaml and targets developers needing precise temporal logic in their applications. While the natural language parsing component is noted as work-in-progress, the core datetime handling is mature and well-tested. The implementation draws inspiration from established libraries like chrono-tz and Ptime, incorporating proven algorithms for calendar calculations and timezone handling.