123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116open!ImportopenStd_internalmoduletypeBasic=sigmoduleSpan:Span_intf.StypetmoduleReplace_polymorphic_compare:Comparable.Comparisonswithtypet:=tincludeComparable.Comparisonswithtypet:=tincludeRobustly_comparablewithtypet:=tvaladd:t->Span.t->tvalsub:t->Span.t->tvaldiff:t->t->Span.t(** [next t] returns the next t (forwards in time) *)valnext:t->t(** [prev t] returns the previous t (backwards in time) *)valprev:t->tvalto_span_since_epoch:t->Span.tvalof_span_since_epoch:Span.t->tendmoduletypeS=sigtypeunderlyingtypet=privateunderlying[@@derivingbin_io,compare,hash,typerep]moduleSpan:Span_intf.Swithtypeunderlying=underlyingmoduleOfday:Ofday_intf.Swithtypeunderlying:=underlyingandmoduleSpan:=SpanincludeBasicwithtypet:=tandmoduleSpan:=SpanincludeComparable.S_commonwithtypet:=tandmoduleReplace_polymorphic_compare:=Replace_polymorphic_compare(** Equivalent to a [Date.t] and an [Ofday.t] with no time zone. A [Date_and_ofday.t]
does not correspond to a single, unambiguous point in time. *)moduleDate_and_ofday:sigtypeabsolute=ttypet=privateunderlying(** {2 Constructors and accessors} *)valof_date_ofday:Date0.t->Ofday.t->tvalto_date_ofday:t->Date0.t*Ofday.tvalto_date:t->Date0.tvalto_ofday:t->Ofday.t(** {2 Conversions between absolute times and date + ofday}
Based on the offset from UTC at the given time. It is usually simpler to use the
[Time.Zone] wrappers of these conversions. *)valof_absolute:absolute->offset_from_utc:Span.t->tvalto_absolute:t->offset_from_utc:Span.t->absolute(** {2 Low-level conversions}
Convert between [t] and a synthetic span representing the difference in date from
epoch, times the length of a day, plus the ofday's distance from midnight.
These spans do not correspond with any actual duration of time. Arithmetic on
these spans is only meaningful within a range where no DST transitions can occur.
For example, rounding to the nearest second makes sense but adding arbitrary spans
does not.
These functions are intended for low-level DST transition arithmetic. Most clients
should not call these functions directly. *)valof_synthetic_span_since_epoch:Span.t->tvalto_synthetic_span_since_epoch:t->Span.tendwithtypeabsolute:=t(** [next_multiple ~base ~after ~interval] returns the smallest [time] of the form:
{[
time = base + k * interval
]}
where [k >= 0] and [time > after]. It is an error if [interval <= 0].
Supplying [~can_equal_after:true] allows the result to satisfy [time >= after].
*)valnext_multiple:?can_equal_after:bool(** default is [false] *)->base:t->after:t->interval:Span.t->unit->t(** [prev_multiple ~base ~before ~interval] returns the largest [time] of the form:
{[
time = base + k * interval
]}
where [k >= 0] and [time < before]. It is an error if [interval <= 0].
Supplying [~can_equal_before:true] allows the result to satisfy [time <= before].
*)valprev_multiple:?can_equal_before:bool(** default is [false] *)->base:t->before:t->interval:Span.t->unit->tvalnow:unit->tend