package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val (=) : t -> t -> bool
val (<>) : t -> t -> bool
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>=) : t -> t -> bool
val (>) : t -> t -> bool
val compare : t -> t -> int
val equal : t -> t -> bool
val max : t -> t -> t
val min : t -> t -> t
val add : t -> int64 -> t
val diff : t -> t -> int64
val of_seconds : int64 -> t
val to_seconds : t -> int64
val of_notation : string -> t option
val of_notation_exn : string -> t
val to_notation : t -> string
val encoding : t Data_encoding.t
val rfc_encoding : t Data_encoding.t
val pp_hum : Stdlib.Format.formatter -> t -> unit
type time = t

Internal timestamp representation.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty-prints the time stamp using RFC3339 format.

val of_seconds_string : string -> time option

Parses RFC3339 representation and returns a timestamp.

val to_seconds_string : time -> string

Returns the timestamp encoded in RFC3339 format.

val (+?) : time -> Period_repr.t -> (time, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result

Adds a time span to a timestamp. This function fails on integer overflow

val (-?) : time -> time -> (Period_repr.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) Stdlib.result

Returns the difference between two timestamps as a time span. This function fails when the difference is negative

val (-) : time -> Period_repr.t -> time

t - p Returns a timestamps p seconds before t.

TODO: https://gitlab.com/tezos/tezos/-/issues/2054 This function should be made available in the environment.

OCaml

Innovation. Community. Security.