Ocaml date parsing library using time formatting directives
| lib | every day isnt monday | |
| test | init | |
| .ocamlformat | init | |
| dune-project | readme, description | |
| LICENSE | init | |
| oadate.opam | readme, description | |
| README.md | readme, description | |
Oadate
Oadate is an ocaml date parsing library that uses date formatting
similar to the date from GNU coreutils. This was made in order to
more flexibly support different date time formats than I could find in
other ocaml libraries -- Ptime only can parse rfc3339 for example,
while this can support rfc5322 time formats.
Currently it only supports the following date formatting directives:
| Directive | Usecase |
|---|---|
%a |
Abbreviated weekday e.g Mon |
%Y |
A 4 character year e.g 2024 |
%m |
Month e.g 01..12 |
%B |
Month name e.g January |
%b |
Abbreviated month name e.g Jan |
%H |
Hour |
%M |
Minute |
%S |
Second |
%z |
Timezone e.g -1000, +3000, 2000 |
Usage
Oadate.parse_time "%a, %d %b %Y %H:%M:%S %z" "2026年1月06日 10:59:49 +0000"
Not that i'd reccomend using it, I dont know anything about ocaml
TODO
- Add tests!!!!!
- Add a way to format timestamps for printing
- Support a fuller set of directives
- Provide a way to extract the full info (e.g day of week, day of year etc)