Is there a way to handle date and time, some sort of module, in ocaml ? Vanilla ocaml i mean, so no OPAM, or this kind of things ?
It seems like there is nothing about it on the internet, i would have expected more docs for the OCaml langage, it's so frustrating...
I need it to do operations on date and time, transform date and times into seconds from epoch, and reverse it, ect...
If there is no way i will do my own functions, but if there is something already done in OCaml for that that would be way better !
OCaml Unix library provides the interface to standard POSIX date/time functions such as time, mktime, gmtime, and localtime. They should be sufficient for your task. See the standard OCaml documentation for futher information.
Also, long time ago I wrote a small library that depends purely on the Unix module, and implements a few useful time transformations. I never published it, but feel free to grab the code, or use it as a set of examples.
And of course, there are plenty of libraries available in OPAM, or via a package manager of your operating system. It is always better, to reuse existing code, rather then duplicate it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With