sig
type span
module Span :
sig
type t = Ptime.span
val v : int * int64 -> Ptime.span
val zero : Ptime.span
val of_d_ps : int * int64 -> Ptime.span option
val unsafe_of_d_ps : int * int64 -> Ptime.span
val unsafe_of_d_ps_option : (int * int64) option -> Ptime.span option
val to_d_ps : Ptime.span -> int * int64
val of_int_s : int -> Ptime.span
val to_int_s : Ptime.span -> int option
val of_float_s : float -> Ptime.span option
val to_float_s : Ptime.span -> float
val equal : Ptime.span -> Ptime.span -> bool
val compare : Ptime.span -> Ptime.span -> int
val neg : Ptime.span -> Ptime.span
val add : Ptime.span -> Ptime.span -> Ptime.span
val sub : Ptime.span -> Ptime.span -> Ptime.span
val abs : Ptime.span -> Ptime.span
val round : frac_s:int -> Ptime.span -> Ptime.span
val truncate : frac_s:int -> Ptime.span -> Ptime.span
val pp : Stdlib.Format.formatter -> Ptime.span -> unit
val dump : Stdlib.Format.formatter -> Ptime.span -> unit
end
type t
val v : int * int64 -> Ptime.t
val epoch : Ptime.t
val min : Ptime.t
val max : Ptime.t
val of_span : Ptime.span -> Ptime.t option
val to_span : Ptime.t -> Ptime.span
val unsafe_of_d_ps : int * int64 -> Ptime.t
val of_float_s : float -> Ptime.t option
val to_float_s : Ptime.t -> float
val truncate : frac_s:int -> Ptime.t -> Ptime.t
val frac_s : Ptime.t -> Ptime.span
val equal : Ptime.t -> Ptime.t -> bool
val compare : Ptime.t -> Ptime.t -> int
val is_earlier : Ptime.t -> than:Ptime.t -> bool
val is_later : Ptime.t -> than:Ptime.t -> bool
val add_span : Ptime.t -> Ptime.span -> Ptime.t option
val sub_span : Ptime.t -> Ptime.span -> Ptime.t option
val diff : Ptime.t -> Ptime.t -> Ptime.span
type tz_offset_s = int
type date = int * int * int
type time = (int * int * int) * Ptime.tz_offset_s
val of_date_time : Ptime.date * Ptime.time -> Ptime.t option
val to_date_time :
?tz_offset_s:Ptime.tz_offset_s -> Ptime.t -> Ptime.date * Ptime.time
val of_date :
?tz_offset_s:Ptime.tz_offset_s -> Ptime.date -> Ptime.t option
val to_date : ?tz_offset_s:Ptime.tz_offset_s -> Ptime.t -> Ptime.date
val of_year : ?tz_offset_s:Ptime.tz_offset_s -> int -> Ptime.t option
val to_year : ?tz_offset_s:Ptime.tz_offset_s -> Ptime.t -> int
type weekday = [ `Fri | `Mon | `Sat | `Sun | `Thu | `Tue | `Wed ]
val weekday : ?tz_offset_s:Ptime.tz_offset_s -> Ptime.t -> Ptime.weekday
val weekday_num : ?tz_offset_s:Ptime.tz_offset_s -> Ptime.t -> int
type error_range = int * int
type rfc3339_error =
[ `Eoi | `Exp_chars of char list | `Invalid_stamp | `Trailing_input ]
val pp_rfc3339_error :
Stdlib.Format.formatter -> Ptime.rfc3339_error -> unit
val rfc3339_error_to_msg :
('a, [ `RFC3339 of Ptime.error_range * Ptime.rfc3339_error ])
Stdlib.result -> ('a, [> `Msg of string ]) Stdlib.result
val rfc3339_string_error :
('a, [ `RFC3339 of Ptime.error_range * Ptime.rfc3339_error ])
Stdlib.result -> ('a, string) Stdlib.result
val of_rfc3339 :
?strict:bool ->
?sub:bool ->
?start:int ->
string ->
(Ptime.t * Ptime.tz_offset_s option * int,
[> `RFC3339 of Ptime.error_range * Ptime.rfc3339_error ])
Stdlib.result
val to_rfc3339 :
?space:bool ->
?frac_s:int -> ?tz_offset_s:Ptime.tz_offset_s -> Ptime.t -> string
val pp_rfc3339 :
?space:bool ->
?frac_s:int ->
?tz_offset_s:Ptime.tz_offset_s ->
unit -> Stdlib.Format.formatter -> Ptime.t -> unit
val pp_human :
?frac_s:int ->
?tz_offset_s:Ptime.tz_offset_s ->
unit -> Stdlib.Format.formatter -> Ptime.t -> unit
val pp : Stdlib.Format.formatter -> Ptime.t -> unit
val dump : Stdlib.Format.formatter -> Ptime.t -> unit
end