Times of day.
t
represents a clock-face time of day. Usually this is equivalent to a time-offset
from midnight, and each t
occurs exactly once in each calendar day. However, when
daylight savings time begins or ends, some clock face times (and therefore t
's) can
occur more than once per day or not at all, and e.g. 04:00 can occur three or five
hours after midnight, so knowing your current offset from midnight is *not* in general
equivalent to knowing the current t
.
(See Zone for tools to help you cope with DST.)
Smallest valid ofday. There is no exposed end_of_day value because the upper end of the range is not closed.
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 s
will not necessarily occur
s
after that day's midnight.
Due to a circular reference, this declaration is found in time.mli.
val now : zone:Zone.t -> t
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.
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 seconds and subseconds are trimmed off if they are 0
trailing milliseconds are trimmed
with milliseconds