daypack-dev/timere

Created Jan 9, 2021 · View the daypack-dev/timere repository page

OCaml date time handling and reasoning suite

Want this for your repo?

Render a free sample of any GitHub repo in seconds.

Visualize your own →

Contributors

3

Lines of Code

2,471

From

Nov 11, 2020

To

Jan 8, 2021

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.

Share this video