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 -> t
add 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 -> t
sub t s
subtracts the span s
from time t
and returns the
resulting time. See important note for add
.val diff : t -> t -> Span.t
diff t1 t2
returns time t1
minus time t2
.val abs_diff : t -> t -> Span.t
diff t1 t2
returns the absolute span of time t1
minus time t2
.val min_value : t
val max_value : t
val of_date_ofday : Date.t -> Ofday.t -> t
val to_date_ofday : t -> Date.t * Ofday.t
val of_date_ofday_utc : Date.t -> Ofday.t -> t
val to_date_ofday_utc : t -> Date.t * Ofday.t
val to_date : t -> Date.t
val to_ofday : t -> Ofday.t
val to_filename_string : t -> string
to_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 -> t
val to_string_fix_proto : [ `Local | `Utc ] -> t -> string
val of_string_fix_proto : [ `Local | `Utc ] -> string -> t
val to_string_old : t -> string
val to_string_trimmed : t -> string
to_string_trimmed t
Same as to_string, but removes trailing seconds and
milliseconds if they are 0val of_date_time_strings : string -> string -> t
val pp : Format.formatter -> t -> unit
val now : unit -> t
val pause : Span.t -> unit
val 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