package devkit

  1. Overview
  2. Docs

Time

type t = float

unix timestamp

type duration = float
val compare : float -> float -> int
val get : unit -> float
val now : unit -> float
val unsafe_digit : int -> char
val put_2d : bytes -> int -> int -> unit
val replace_year_2019 : bytes -> int -> unit
val fast_to_string : gmt:bool -> float -> string
val to_string : ?gmt:bool -> ?ms:bool -> float -> string
val gmt_string : float -> string
val gmt_string_ms : float -> string
val format_date_w3 : Unix.tm -> string

YYYY-MM-DD

val format_date8 : Unix.tm -> string

YYYYMMDD

val format_date8h : Unix.tm -> string

YYYYMMDDhh

val format_date8hm : Unix.tm -> string

YYYYMMDDhhmm

val format_date8hms : Unix.tm -> string

YYYYMMDDhhmmss

val format_date4 : Unix.tm -> string

MMDD

val date_w3_gmt_string : float -> string
val date_w3_string : float -> string
val date8_gmt_string : float -> string
val date8_string : float -> string
val date8h_gmt_string : float -> string
val date8h_string : float -> string
val date8hm_gmt_string : float -> string
val date8hm_string : float -> string
val date8hms_gmt_string : float -> string
val date8hms_string : float -> string
val date4_gmt_string : float -> string
val date4_string : float -> string
val to_rfc2822 : float -> string

unix timestamp to RFC-2822 date Example: Tue, 15 Nov 1994 12:45:26 GMT

val show_duration : ?cut:int -> float -> string
  • parameter cut
    • only show this number of most significant components
val duration_str : ?cut:int -> float -> string
val show_compact_duration : ?full:bool -> ?cut:int -> float -> string
val compact_duration : ?full:bool -> ?cut:int -> float -> string
val of_compact_duration : string -> float

parse compact_duration representation (except for fractional seconds)

val minutes : int -> float
val hours : int -> float
val days : int -> float
val seconds : int -> float
val msec : int -> float

convert integer number of milliseconds to Time.t

val nsec : int -> float

convert integer number of nanoseconds to Time.t

val int : float -> int
val to_sec : float -> int
val to_ms : float -> int
val ago : float -> float
val ago_str : float -> string
OCaml

Innovation. Community. Security.