package core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

See Time.Ofday.

See Time.Ofday.

type t = private Core_kernel.Int63.t
include sig ... end
val typerep_of_t : t Typerep_lib.Std.Typerep.t
val typename_of_t : t Typerep_lib.Std.Typename.t

String and sexp output takes the form 'HH:MM:SS.sssssssss'; see Core_kernel.Ofday_intf for accepted input. If input includes more than 9 decimal places in seconds, rounds to the nearest nanosecond, with the midpoint rounded up. Allows 60.sss... seconds for leap seconds but treats it as exactly 60s regardless of fractional part.

include Core_kernel.Identifiable with type t := t
include sig ... end
val bin_read_t : t Bin_prot.Read.reader
val __bin_read_t__ : (Base.Int.t -> t) Bin_prot.Read.reader
val bin_reader_t : t Bin_prot.Type_class.reader
val bin_size_t : t Bin_prot.Size.sizer
val bin_write_t : t Bin_prot.Write.writer
val bin_writer_t : t Bin_prot.Type_class.writer
val bin_shape_t : Bin_prot.Shape.t
val t_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> t
include Core_kernel.Identifiable.S_common with type t := t
include sig ... end
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
include Base.Stringable.S with type t := t
val of_string : string -> t
val to_string : t -> string
include Base.Pretty_printer.S with type t := t
val pp : Base.Formatter.t -> t -> unit
include Core_kernel.Comparable.S_binable with type t := t
include Base.Comparable.S with type t := t
include Base.Comparisons.S with type t := t
include Base.Comparisons.Infix with type t := t
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 equal : t -> t -> bool
val compare : t -> t -> int

compare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.

val min : t -> t -> t
val max : t -> t -> t
val ascending : t -> t -> int

ascending is identical to compare. descending x y = ascending y x. These are intended to be mnemonic when used like List.sort ~compare:ascending and List.sort ~cmp:descending, since they cause the list to be sorted in ascending or descending order, respectively.

val descending : t -> t -> int
val between : t -> low:t -> high:t -> bool

between t ~low ~high means low <= t <= high

val clamp_exn : t -> min:t -> max:t -> t

clamp_exn t ~min ~max returns t', the closest value to t such that between t' ~low:min ~high:max is true.

Raises if not (min <= max).

val clamp : t -> min:t -> max:t -> t Base.Or_error.t
include Base.Comparator.S with type t := t
type comparator_witness
val validate_lbound : min:t Base.Maybe_bound.t -> t Base.Validate.check
val validate_ubound : max:t Base.Maybe_bound.t -> t Base.Validate.check
val validate_bound : min:t Base.Maybe_bound.t -> max:t Base.Maybe_bound.t -> t Base.Validate.check
include Core_kernel.Hashable.S_binable with type t := t
include sig ... end
val hash_fold_t : Base.Hash.state -> t -> Base.Hash.state
val hash : t -> Base.Hash.hash_value
val hashable : t Base.Hashable.t
include Core_kernel.Comparable.With_zero with type t := t
val validate_positive : t Base.Validate.check
val validate_non_negative : t Base.Validate.check
val validate_negative : t Base.Validate.check
val validate_non_positive : t Base.Validate.check
val is_positive : t -> bool
val is_non_negative : t -> bool
val is_negative : t -> bool
val is_non_positive : t -> bool
val sign : t -> Base__.Sign0.t

Returns Neg, Zero, or Pos in a way consistent with the above functions.

val add_exn : t -> Core_kernel.Time_ns.Span.t -> t

On some days, add_exn t span doesn't occur span from t in real time. For example, this happens on days when daylight saving time begins or ends. See Time.Ofday for more detail.

val sub_exn : t -> Core_kernel.Time_ns.Span.t -> t
val diff : t -> t -> Core_kernel.Time_ns.Span.t
val now : zone:Core_kernel__.Zone.t -> t
val to_millisecond_string : t -> string
val start_of_day : t
val start_of_next_day : t
val approximate_end_of_day : t

The largest representable value below start_of_next_day, i.e. one nanosecond before midnight.

val to_span_since_start_of_day : t -> Core_kernel.Time_ns.Span.t
val of_span_since_start_of_day_exn : Core_kernel.Time_ns.Span.t -> t
val create : ?hr:int -> ?min:int -> ?sec:int -> ?ms:int -> ?us:int -> ?ns:int -> unit -> t
module Stable : sig ... end
module Option : sig ... end
OCaml

Innovation. Community. Security.