A date calculation library, with exact operators to add a given number of days to a date, and approximate operators to add months or years.
Published: 13 Nov 2023
A date calculation library
This library handles dates (
YYYY-MM-DD) and periods (in days, months and years). It provides operators on dates and periods. The addition of dates and periods containing months or years is a tricky case that may require roundings. We have taken special care to define those rounding operators and expose different rounding modes for users.
This library is a work in progress. You can find the library's description in
lib/dates.mli. There is also a Python implementation (which corresponds to a port of the OCaml implementation).
We have a paper under submission that will detail the full semantics of this library.
opam install dates_calc or
opam install . if you've cloned the git repository.
Building the documentation
The documentation can be built with
dune build @doc, and is then available in