[ANN] ptime 1.1.0 and mtime 2.0.0


I’d like to announce new releases of ptime and mtime. Ptime and mtime provide types and clocks for POSIX and monotonic time. A few highlights:

  • Ptime’s non-strict RFC 3339 parsing is further relaxed to parse hhmm and hh time zones (strict is hh:mm). This is sometimes found in web services. Strictly speaking it means a larger subset of ISO 8601 is parsed. Other than that the release adds a few more convenience API entry points for dealing with years and weekdays, see the release notes for all the details.

  • On Linux and MacOS Mtime_clock does now take into account system sleep time by respectively using CLOCK_BOOTTIME and mach_continuous_time (thanks to @BikalGurung for the patch).

  • The Mtime module suffered a bit of floating point conversion mess and bugs (thanks to @talex5 for reporting). The functions deprecated in 1.4.0 have now been removed[1] and the single point of conversion with floats are the Mtime.Span.{to,of}_float_ns functions.

Other changes are described in the release notes for ptime and mtime.

Home pages: ptime, mtime
Docs & manuals: ptime, mtime or odig doc ptime mtime
Install: opam install ptime mtime



A big thanks to my donators. I welcome and thank the new donator @jhw.

  1. It seems that this lead to quite a bit of breakage on the opam-repository. Sorry about that I didn’t know there were so many packages using mtime. ↩︎


thanks for a forgiving parser. RFC3339 is a standard hard to comply with, as is has gems in it like

No, RFC 3339 explicitly allows the use of space. It says:

NOTE: ISO 8601 defines date and time separated by “T”.
Applications using this syntax may choose, for the sake of
readability, to specify a full-date and full-time separated by
(say) a space character.

This paragraph was put into the RFC at my suggestion, precisely so that GNU
“date” output wouldn’t have to contain that “T”.