Mavryk_raw_protocol_001_PtAtLas.Time_repr
include module type of struct include Mavryk_protocol_environment_001_PtAtLas.Time end
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 Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t
val rfc_encoding : t Mavryk_protocol_environment_001_PtAtLas.Data_encoding.t
val pp_hum :
Mavryk_protocol_environment_001_PtAtLas.Format.formatter ->
t ->
unit
type time = t
Internal timestamp representation.
val pp : Mavryk_protocol_environment_001_PtAtLas.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 Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Adds a time span to a timestamp. This function fails on integer overflow
val (-?) :
time ->
time ->
Period_repr.t Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
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.