[ANN] Timere 0.1.3 - Dealing with time and time zones has never been easier

I am happy to announce first release of Timere, a time handling and reasoning library, which @Drup and I have been working on recently.

Examples

Christmases which fall on Wednesday from now

let () =
  let open Timere in
  match
    resolve (
      after (Date_time.now ())
      & months [`Dec]
      & days [25]
      & weekdays [`Wed]
    )
  with
  | Error msg -> failwith msg
  | Ok s ->
    Fmt.pr "%a@." (pp_intervals ~sep:(Fmt.any "@.") ()) s

gives

[2024 Dec 25 00:00:00 +00:00:00, 2024 Dec 26 00:00:00 +00:00:00)
[2030 Dec 25 00:00:00 +00:00:00, 2030 Dec 26 00:00:00 +00:00:00)
[2041 Dec 25 00:00:00 +00:00:00, 2041 Dec 26 00:00:00 +00:00:00)
[2047 Dec 25 00:00:00 +00:00:00, 2047 Dec 26 00:00:00 +00:00:00)
[2052 Dec 25 00:00:00 +00:00:00, 2052 Dec 26 00:00:00 +00:00:00)
[2058 Dec 25 00:00:00 +00:00:00, 2058 Dec 26 00:00:00 +00:00:00)
...

See here for more examples

Features

  • Timestamp and date time handling with platform independent time zone support
    • Subset of the IANA time zone database is built into this library
  • Reasoning over time intervals via timere objects/expressions, examples:
    • Pattern matching time and intervals. These work across DST boundaries.
    • Intersection and union
    • Chunking at year or month boundary, or in fixed sizes
    • Evaluate (sub)expressions with a different time zone (e.g. intersection of 9am to 5pm of Sydney and 9am to 5pm of New York)

Links

18 Likes

Timere 0.2.1 has landed!

Timere is a date time handling and reasoning library, with time zone awareness. You can use it as a calendar library or as part of a scheduling library for resolving some time constraints.

This release adds nanosecond precision support to timere (and fractional second support at various places), along with other small improvements.

3 Likes