package dates_calc
Install
Dune Dependency
Authors
Maintainers
Sources
md5=9245ad512274ecabee0aeb3ba927ea3d
sha512=ffb35dc69a51424c2e465341ac07e5e46fac3a16d88ec9e9e450418134ff62825aa8b826078cb3c048f5be609008931bd7e06b940545d6a8ce4bdb0542f485a9
Description
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: 14 May 2025
README
A date calculation library
Aim
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 are also a Python and C implementations (which correspond to ports of the OCaml implementation).
The full semantics of the library has been formalized and is available in the related ESOP 2024 paper Formalizing Date Arithmetic and Statically Detecting Ambiguities for the Law.
Installation
Just run 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 doc/odoc.html
.
Dev Dependencies (5)
-
odoc
with-doc
-
conf-openjdk
with-test
-
conf-python-3
with-test
-
qcheck
with-test & >= "0.10"
-
alcotest
with-test & >= "1.0.0"
Used by (1)
-
catala
>= "0.8.0"
Conflicts
None