1
0
Fork
You've already forked oadate
0
Ocaml date parsing library using time formatting directives
  • OCaml 91.8%
  • Dune 8.2%
Find a file
2026年01月06日 15:50:45 +00:00
lib every day isnt monday 2026年01月06日 15:50:45 +00:00
test init 2026年01月06日 11:33:23 +00:00
.ocamlformat init 2026年01月06日 11:33:23 +00:00
dune-project readme, description 2026年01月06日 15:20:14 +00:00
LICENSE init 2026年01月06日 11:33:23 +00:00
oadate.opam readme, description 2026年01月06日 15:20:14 +00:00
README.md readme, description 2026年01月06日 15:20:14 +00:00

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)