module Time:Our time module. This module wraps up unix times, including various convenience functions for accessing them.sig..end
module Span:sig..end
module Ofday:sig..end
module Date:sig..end
type t
include Hashable
include Comparable
include Robustly_comparable
include Sexpable
include Binable
include Stringable
include Floatable
val add : t -> Span.t -> tadd t s adds the span s to time t and returns the resulting time.
NOTE: adding spans as a means of adding days is not accurate, and may run into trouble
due to shifts in daylight savings time, float arithmetic issues, and leap seconds.
See the comment at the top of TZ.mli for a more complete discussion of some of the
issues of time-keeping. For spans that cross date boundaries, use date functions
instead.
val sub : t -> Span.t -> tsub t s subtracts the span s from time t and returns the
resulting time. See important note for add.val diff : t -> t -> Span.tdiff t1 t2 returns time t1 minus time t2.val abs_diff : t -> t -> Span.tdiff t1 t2 returns the absolute span of time t1 minus time t2.val min_value : tval max_value : tval of_date_ofday : Date.t -> Ofday.t -> tval to_date_ofday : t -> Date.t * Ofday.tval of_date_ofday_utc : Date.t -> Ofday.t -> tval to_date_ofday_utc : t -> Date.t * Ofday.tval to_date : t -> Date.tval to_ofday : t -> Ofday.tval to_filename_string : t -> stringto_filename_string t converts t to string with format YYYY-MM-DD_HH-MM-SS.mmm
which is suitable for using in filenames
of_filename_string s converts s that has format YYYY-MM-DD_HH-MM-SS.mmm into time
val of_filename_string : string -> tval to_string_fix_proto : [ `Local | `Utc ] -> t -> stringval of_string_fix_proto : [ `Local | `Utc ] -> string -> tval to_string_old : t -> stringval to_string_trimmed : t -> stringto_string_trimmed t Same as to_string, but removes trailing seconds and
milliseconds if they are 0val of_date_time_strings : string -> string -> tval pp : Format.formatter -> t -> unitval now : unit -> tval pause : Span.t -> unitval ofday_occurrence : Ofday.t -> [ `right_after | `right_before ] -> t -> t ofday_occurrence ofday side now returns a Time.t that is the occurrence of ofday
which is the latest occurrence before now or the earliest occurrence after now,
according to side.
NOTE: This function is a little bit wrong near daylight savings timeval ofday_occurrence_utc : Ofday.t -> [ `right_after | `right_before ] -> t -> t