package mirage-ptime

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

POSIX clock

val now : unit -> Ptime.t

now_d_ps () is the current POSIX time.

val period : unit -> Ptime.span option

period () is a positive POSIX time span representing the clock'd period (if available).

System time zone offset

val current_tz_offset_s : unit -> int option

current_tz_offset_s () is the clock's current local time zone offset to UTC in seconds, if known. This is the duration local time - UTC time in seconds.

POSIX clock raw interface

val now_d_ps : unit -> int * int64

now_d_ps () is (d, ps) representing POSIX time occuring at d * 86'400e12 + ps POSIX picoseconds from the epoch 1970-01-01 00:00:00 UTC. ps is in the range [0;86_399_999_999_999_999L].

Raises Sys_error, see error handling

val period_d_ps : unit -> (int * int64) option

period_d_ps () is if available Some (d, ps) representing the clock's picosecond period d * 86'400e12 + ps. ps is in the range [0;86_399_999_999_999_999L].

OCaml

Innovation. Community. Security.