[ANN] Timedesc 0.1.0 - date time handling library

I’m pleased to announce the first release of Timedesc. Timedesc provides utilities to describe points of time, and properly handle calendar and time zone information.

You can find the tutorial and API doc here.

Features

  • Timestamp and date time handling with platform independent time zone support
    • Subset of the IANA time zone database is built into this library
  • Supports Gregorian calendar date, ISO week date, and ISO ordinal date
  • Supports nanosecond precision
  • ISO8601 parsing and RFC3339 printing

Some context

This is a much more polished repackaging of the date time components from Timere. The separation and restructuring came from the growing size of the date time components, and very nice and extensive feedback on UX from @gasche at issue #25 and other issues branching from it (many thanks!).

And as usual, many thanks to @Drup for his advice.

14 Likes

Congratulations and thanks for releasing this useful addition to OCaml ecosystem. :partying_face:

While trying to use it in utop via #require timedesc, I get the error below,

Error: Reference to undefined global `Timedesc_tzlocal

I tried adding both timedesc.tzlocal and timedesc.tzdb.full but not luck. Is there some invocation that I am missing to use it in utop?
B.

edit - It seems to work if I require timedesc.tzlocal.utc before timedesc

1 Like

Yep one needs to pick an explicit backend for time zone data source (e.g. timedesc.tzdb.full) and explicit implementation for local time zone detection (e.g. timedesc.tzlocal.unix).

I’ll update the readme with section for utop use (never occurred to me that I should write it down, even though I personally invoke timedesc via utop quite often).

EDIT: done

2 Likes