[ANN] Timedesc 0.4.0 - date time handling library

I’m pleased to announce the release of Timedesc 0.4.0.

Timedesc provides utilities to describe points of time, and properly handle calendar and time zone information.

Tutorial and API doc can be found 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

Major changes since 0.1.0

  • Added ceil, floor, and round to Timedesc.Span

  • Better support for second fraction for non-RFC3339 pretty printers

    • This includes automatic deduction of smallest number of fractional digits required for lossless representation, previously only used for RFC3339 pretty printers (see {sec-frac:c} description)
  • Added Timedesc.Zoneless module for better time zone-less date time support

  • Added compare_chrono_min, compare_chrono_max, and compare_struct for comparing Timedesc.t values

9 Likes

That’s excellent. I wish we’d had such library when we were working with calendars at Esper (2013-2017). We were focused on improving how meetings are scheduled. I’m curious about your use case!

It was actually born out of need for scheduling as well : D

We used ptime at some point, but requiring user to specify time zone offset renders a lot of things unusable in practice, namely I kept asking myself “how am I supposed to know what’s the time zone offset 5 months from now?”. The only (afaict) other libraries that supports time zone properly were Jane Street Core_kernel side of things, but it does not expose the underlying low-level information required, and relies on the OS tzdb, this make some scheduling impossible and overall less portable.

So we ended up deciding to make a modern date time library inside the scheduling library Timere, later repackaged into a standalone library which is Timedesc now.

1 Like