package core_unix
Module Time_float_unix.OfdaySource
include module type of struct include Time.Ofday end
include Bin_prot.Binable.S with type t := t
include Bin_prot.Binable.S_only_functions with type t := t
This function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.
include Core.Interfaces.Comparable_binable with type t := t
include Base.Comparable.S with type t := t
include Base.Comparisons.S with type t := t
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.
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.
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).
include Base.Comparator.S with type t := t
include Core.Comparator.S
with type t := t
with type comparator_witness := comparator_witness
include Core.Interfaces.Hashable_binable with type t := t
include Diffable.S_atomic with type t := t
module Diff = Time.Ofday.Diffinclude Base.Pretty_printer.S with type t := t
include Core.Quickcheck.S_range with type t := t
gen_incl lower_bound upper_bound produces values between lower_bound and upper_bound, inclusive. It uses an ad hoc distribution that stresses boundary conditions more often than a uniform distribution, while still able to produce any value in the range. Raises if lower_bound > upper_bound.
gen_uniform_incl lower_bound upper_bound produces a generator for values uniformly distributed between lower_bound and upper_bound, inclusive. Raises if lower_bound > upper_bound.
of_string supports and correctly interprets 12h strings with the following suffixes:
"A", "AM", "A.M.", "A.M" "P", "PM", "P.M.", "P.M"
as well as the lowercase and space-prefixed versions of these suffixes.
of_string also fully supports 24h wall-clock times.
to_string only produces the 24h format.
val create :
?hr:Base.Int.t ->
?min:Base.Int.t ->
?sec:Base.Int.t ->
?ms:Base.Int.t ->
?us:Base.Int.t ->
?ns:Base.Int.t ->
Base.Unit.t ->
tLargest representable ofday; see notes above on how start_of_next_day behaves differently from other ofday values.
A time very close to the end of a day. Not necessarily the largest representable value before start_of_next_day, but as close as possible such that using this ofday with Time.of_date_ofday and Time.to_date should round-trip to the same date. With floating-point representations of time, this may not be possible for dates extremely far from epoch.
The clock-face time represented by approximate_end_of_day may vary with different time and ofday representations, depending on their precision.
Note that these names are only really accurate on days without DST transitions. When clocks move forward or back, of_span_since_start_of_day_exn s will not necessarily occur s after that day's midnight.
Reports whether a span represents a valid time since the start of the day, i.e. whether of_span_since_start_of_day_exn span would succeed.
of_span_since_start_of_day_unchecked does not validate that the Span represents a valid Ofday.
Behavior of other Ofday accessors is unspecified, but still safe (e.g., won't segfault), if the input does not satisfy span_since_start_of_day_is_valid.
add t s shifts the time of day t by the span s. It returns None if the result is not in the same 24-hour day.
next t return the next t (next t > t) or None if t = end of day.
prev t return the previous t (prev t < t) or None if t = start of day.
diff t1 t2 returns the difference in time between two ofdays, as if they occurred on the same 24-hour day.
Returns the time-span separating the two of-days, ignoring the hour information, and assuming that the of-days represent times that are within a half-hour of each other. This is useful for comparing two ofdays in unknown time-zones.
Trailing groups of zeroes are trimmed such that the output is printed in terms of the smallest non-zero units among nanoseconds, microseconds, milliseconds, or seconds; or minutes if all of the above are zero.
HH:MM:SS, without any subsecond components. Seconds appear even if they are zero.
24-hour times according to the ISO 8601 standard. This function can raise.
with milliseconds