package devkit

  1. Overview
  2. Docs

Time

type t = float

unix timestamp

type duration = float
include sig ... end
exception Parse_compact_duration of string
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_yyyy : bytes -> Unix.tm -> unit
val yyyy : string
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_basic : Unix.tm -> string

YYYY-MM-DD hh:mm:ss

val format_date4 : Unix.tm -> string

MMDD

val format_date_yyyymm : Unix.tm -> string

YYYYMM

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 basic_gmt_string : float -> string
val basic_string : float -> string
val date4_gmt_string : float -> string
val date4_string : float -> string
val date_gmt_yyyymm_string : float -> string
val date_yyyymm_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 seconds_1m : int
val seconds_1h : int
val seconds_1d : int
val time_x : int -> (int -> float) * (float -> int) * (float -> float)
val seconds : int -> float
val to_seconds : float -> int
val round_seconds : float -> float
val minutes : int -> float
val to_minutes : float -> int
val round_minutes : float -> float
val hours : int -> float
val to_hours : float -> int
val round_hours : float -> float
val days : int -> float
val to_days : float -> int
val round_days : float -> 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 to_ms : float -> int
val ago : float -> float
val ago_str : float -> string
val int : float -> int
val to_sec : float -> int
OCaml

Innovation. Community. Security.