Up

module Ofday

: sig
#
type t = private float
#
module Zoned : sig

A time of day along with a time zone.

Expresses things like "Seinfeld moved to 6:30pm EST.", while a plain Ofday expresses something more like "I eat lunch at noon (in whichever timezone I'm in at the time).".

#
type ofday = t

Sexps look like "(12:01 nyc)"

Two t's may or may not correspond to the same times depending on which date they're evaluated.

#
type t
include Core_kernel.Std.Stringable with type t := t
include Core_kernel.Std.Comparable_binable with type t := t
include Core_kernel.Std.Hashable_binable with type t := t
include Core_kernel.Std.Pretty_printer.S with type t := t
#
val create : ofday -> Zone.t -> t
#
val create_local : ofday -> t
#
val ofday : t -> ofday
#
val zone : t -> Zone.t
#
module Stable : sig
#
module V1 : sig
include sig
#
type __pa_nonrec_0 = t
#
type t = __pa_nonrec_0
end
with type __pa_nonrec_0 := t
#
val bin_t : t Core_kernel.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core_kernel.Std.Bin_prot.Type_class.writer
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
end
end
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val bin_t : t Core_kernel.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core_kernel.Std.Bin_prot.Type_class.writer
end
include Core_kernel.Std.Comparable_binable with type t := t
include Core_kernel.Std.Comparable.With_zero with type t := t
include Core_kernel.Std.Floatable with type t := t
include Core_kernel.Std.Hashable_binable with type t := t
include Core_kernel.Std.Pretty_printer.S with type t := t
include Core_kernel.Std.Robustly_comparable with type t := t
include Core_kernel.Std.Stringable with type t := t
#
val create : ?hr:int -> ?min:int -> ?sec:int -> ?ms:int -> ?us:int -> unit -> t
#
val to_parts : t -> Span.Parts.t
#
val start_of_day : t
#
val end_of_day : t
#
val to_span_since_start_of_day : t -> Span.t
#
val of_span_since_start_of_day : Span.t -> t
#
val add : t -> Span.t -> t option

add t s shifts the time of day t by the span s. It returns None if the result is not in the same day.

#
val sub : t -> Span.t -> t option
#
val diff : t -> t -> Span.t

diff t1 t2 returns the difference in time between two ofdays, as if they occurred on the same day

#
val small_diff : t -> t -> Span.t
#
val to_string_trimmed : t -> string

trailing seconds and subseconds are trimmed off if they are 0

#
val to_sec_string : t -> string

trailing milliseconds are trimmed

#
val of_string_iso8601_extended : ?pos:int -> ?len:int -> string -> t
#
val to_millisec_string : t -> string

with milliseconds

#
module Stable : sig
#
module V1 : sig
include sig
#
type __pa_nonrec_1 = t
#
type t = __pa_nonrec_1
end
with type __pa_nonrec_1 := t
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val compare : t -> t -> int
#
val bin_t : t Core_kernel.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core_kernel.Std.Bin_prot.Type_class.writer
end
end
#
val t_of_sexp : Sexplib.Sexp.t -> t
#
val sexp_of_t : t -> Sexplib.Sexp.t
#
val bin_t : t Core_kernel.Std.Bin_prot.Type_class.t
#
val bin_read_t : t Core_kernel.Std.Bin_prot.Read.reader
#
val __bin_read_t__ : (int -> t) Core_kernel.Std.Bin_prot.Read.reader
#
val bin_reader_t : t Core_kernel.Std.Bin_prot.Type_class.reader
#
val bin_size_t : t Core_kernel.Std.Bin_prot.Size.sizer
#
val bin_write_t : t Core_kernel.Std.Bin_prot.Write.writer
#
val bin_writer_t : t Core_kernel.Std.Bin_prot.Type_class.writer
end