Module Time.Date_and_ofday

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.

type absolute = t
type t = private underlying

Constructors and accessors

val of_date_ofday : Core_kernel__.Date0.t -> Ofday.t -> t
val to_date_ofday : t -> Core_kernel__.Date0.t * Ofday.t
val to_date : t -> Core_kernel__.Date0.t
val to_ofday : t -> Ofday.t

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.

val of_absolute : absolute -> offset_from_utc:Span.t -> t
val to_absolute : t -> offset_from_utc:Span.t -> absolute

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.

val of_synthetic_span_since_epoch : Span.t -> t
val to_synthetic_span_since_epoch : t -> Span.t