package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Represents a timezone-relative time, rather than an absolute time. This is equivalent to a Date.t and an Ofday.t with no time zone. A Relative_to_unspecified_zone.t does not correspond to a single, unambiguous point in time. Intended as a low-level back-end for high-level timezone-based functions; most clients should not use Relative_to_unspecified_zone.t.

Represents a timezone-relative time, rather than an absolute time. This is equivalent to a Date.t and an Ofday.t with no time zone. A Relative_to_unspecified_zone.t does not correspond to a single, unambiguous point in time. Intended as a low-level back-end for high-level timezone-based functions; most clients should not use Relative_to_unspecified_zone.t.

type t = private Base.Float.t

to_span_since_epoch and of_span_since_epoch don't precisely mean the UNIX epoch as a moment in time, but rather the timezone-relative date-ofday pair 1970-01-01 00:00:00.

Likewise add and sub and diff all have slightly subtle meanings, where the Time.Span.t values involved don't necessarily always translate exactly to an elapsed period of time. (You can add 2h to a timezone-relative time and get one that occurs only 1h later in real-time terms, or 3h later).

module Replace_polymorphic_compare : sig ... end
val (>=) : t -> t -> bool
val (<=) : t -> t -> bool
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (<) : t -> t -> bool
val (<>) : t -> t -> bool
val equal : t -> t -> bool
val compare : t -> t -> int
val min : t -> t -> t
val max : t -> t -> t
val (>=.) : t -> t -> bool
val (<=.) : t -> t -> bool
val (=.) : t -> t -> bool
val (>.) : t -> t -> bool
val (<.) : t -> t -> bool
val (<>.) : t -> t -> bool
val robustly_compare : t -> t -> int
val add : t -> Base.Float.t -> t
val sub : t -> Base.Float.t -> t
val diff : t -> t -> Base.Float.t
val next : t -> t

next t returns the next t (forwards in time)

val prev : t -> t

prev t returns the previous t (backwards in time)

val to_span_since_epoch : t -> Base.Float.t
val of_span_since_epoch : Base.Float.t -> t
val of_date_ofday : Core_kernel__.Date0.t -> Base.Float.t -> t

Conversions between relative times and date/ofday.

val to_date_ofday : t -> Core_kernel__.Date0.t * Base.Float.t
val to_date : t -> Core_kernel__.Date0.t
val to_ofday : t -> Base.Float.t
val of_absolute : Base.Float.t -> offset_from_utc:Base.Float.t -> t

Conversions between absolute and relative time, based on the offset from UTC at the given time. Use the high-level Time.Zone wrappers of these conversions.

val to_absolute : t -> offset_from_utc:Base.Float.t -> Base.Float.t