package timedesc

  1. Overview
  2. Docs

Time zone information that can be attached to date time like data

type t = private {
  1. tz : Time_zone.t;
  2. fixed_offset_from_utc : Span.t option;
}

Time zone information of date time.

tz is the time zone tied. This is always defined even if only an offset provided during construction - if say only offset of 10 hours is provided, tz becomes "UTC+10".

fixed_offset_from_utc is the fixed offset from UTC. This is defined if it is provided by user or if the time zone can be represented by a fixed offset, e.g. "UTC+1" can be represented by fixed offset of 1 hour.

type error = [
  1. | `Missing_both_tz_and_fixed_offset_from_utc
  2. | `Invalid_offset of Span.t
  3. | `Unrecorded_offset of Span.t
]
val make : ?tz:Time_zone.t -> ?fixed_offset_from_utc:Span.t -> unit -> (t, error) Stdlib.result
val equal : t -> t -> bool
val of_sexp : CCSexp.t -> (t, string) Stdlib.result
val to_sexp : t -> CCSexp.t
OCaml

Innovation. Community. Security.