include Core__.Core_zone_intf.Core_zonemodule type Extend_zone = Core__.Core_zone_intf.Extend_zoneinclude Core__.Import.Core_kernel_private.Time_zone.S with type t = Core__.Import.Time.Zone.tThe type of a time-zone.
bin_io and sexp representations of Zone.t are the name of the zone, and
not the full data that is read from disk when Zone.find is called. The
full Zone.t is reconstructed on the receiving/reading side by reloading
the zone file from disk. Any zone name that is accepted by find is
acceptable in the bin_io and sexp representations.
val input_tz_file : zonename:Core_kernel__.Import.string ‑> filename:Core_kernel__.Import.string ‑> tinput_tz_file ~zonename ~filename read in filename and return t
with name t = zonename
val likely_machine_zones : Core_kernel__.Import.string Core_kernel__.Import.list Core_kernel__.Import.reflikely_machine_zones is a list of zone names that will be searched
first when trying to determine the machine zone of a box. Setting this
to a likely set of zones for your application will speed the very first
use of the local timezone.
val of_utc_offset : hours:Core_kernel__.Import.int ‑> tof_utc_offset offset returns a timezone with a static UTC offset (given in
hours).
val name : t ‑> Core_kernel__.Import.stringval original_filename : t ‑> Core_kernel__.Import.string Core_kernel__.Import.optionoriginal_filename t return the filename t was loaded from (if any)
val digest : t ‑> Core_kernel.Md5.t Core_kernel__.Import.optiondigest t return the MD5 digest of the file the t was created from (if any)
val reset_transition_cache : t ‑> Core_kernel__.Import.unitFor performance testing only; reset_transition_cache t resets an internal cache in
t used to speed up repeated lookups of the same clock shift transition.
module Index : sig ... endA time zone index refers to a range of times delimited by DST transitions at one or both ends. Every time belongs to exactly one such range. The times of DST transitions themselves belong to the range for which they are the lower bound.
val index_of_relative : t ‑> Time_in_seconds.Relative_to_unspecified_zone.t ‑> Index.tval index_offset_from_utc_exn : t ‑> Index.t ‑> Time_in_seconds.Span.tGets the UTC offset of times in a specific range.
This can raise if you use an Index.t that is out of bounds for this t.
val index_abbreviation_exn : t ‑> Index.t ‑> Core_kernel__.Import.stringindex_abbreviation_exn t index returns the abbreviation name (such as EDT, EST,
JST) of given zone t for the range of index. This string conversion is one-way
only, and cannot reliably be turned back into a t. This function reads and writes
the zone's cached index. Raises if index is out of bounds for t.
val index_has_prev_clock_shift : t ‑> Index.t ‑> Core_kernel__.Import.boolAccessors for the DST transitions delimiting the start and end of a range, if any.
The _exn accessors raise if there is no such transition. These accessors are split
up to increase performance and improve allocation; they are intended as a low-level
back-end for commonly-used time conversion functions. See Time.Zone and
Time_ns.Zone for higher-level accessors that return an optional tuple for clock
shifts in either direction.
val index_prev_clock_shift_time_exn : t ‑> Index.t ‑> Time_in_seconds.tval index_prev_clock_shift_amount_exn : t ‑> Index.t ‑> Time_in_seconds.Span.tval index_has_next_clock_shift : t ‑> Index.t ‑> Core_kernel__.Import.boolval index_next_clock_shift_time_exn : t ‑> Index.t ‑> Time_in_seconds.tval index_next_clock_shift_amount_exn : t ‑> Index.t ‑> Time_in_seconds.Span.tinclude Extend_zone with type Extend_zone.t := tinclude Core__.Import.Identifiable.S with type t := tinclude sig ... endval bin_t : t Bin_prot.Type_class.tval bin_read_t : t Bin_prot.Read.readerval __bin_read_t__ : (Core_kernel__.Import.int ‑> t) Bin_prot.Read.readerval bin_reader_t : t Bin_prot.Type_class.readerval bin_size_t : t Bin_prot.Size.sizerval bin_write_t : t Bin_prot.Write.writerval bin_writer_t : t Bin_prot.Type_class.writerval bin_shape_t : Bin_prot.Shape.tval hash_fold_t : Base.Hash.state ‑> t ‑> Base.Hash.stateval hash : t ‑> Base.Hash.hash_valueval t_of_sexp : Base.Sexp.t ‑> tval sexp_of_t : t ‑> Base.Sexp.tinclude Core__.Import.Identifiable.S_common with type t := tinclude sig ... endval compare : t ‑> t ‑> Core_kernel__.Import.intval hash_fold_t : Base.Hash.state ‑> t ‑> Base.Hash.stateval hash : t ‑> Base.Hash.hash_valueval sexp_of_t : t ‑> Base.Sexp.tinclude Core_kernel__.Import.Stringable.S with type t := tval of_string : string ‑> tval to_string : t ‑> stringinclude Core_kernel__.Import.Pretty_printer.S with type t := tval pp : Base.Formatter.t ‑> t ‑> unitinclude Core_kernel.Comparable.S_binable with type t := tinclude Core_kernel__.Comparable_intf.S_commoninclude Base.Comparable.Sinclude Base__.Comparable_intf.Polymorphic_compareascending is identical to compare. descending x y = ascending y x. These are
intended to be mnemonic when used like List.sort ~compare:ascending and List.sort
~cmp:descending, since they cause the list to be sorted in ascending or descending
order, respectively.
clamp_exn t ~min ~max returns t', the closest value to t such that
between t' ~low:min ~high:max is true.
Raises if not (min <= max).
val clamp : t ‑> min:t ‑> max:t ‑> t Base.Or_error.tinclude Base.Comparator.S with type t := tval comparator : (t, comparator_witness) Base.Comparator.comparatorinclude Base__.Comparable_intf.Validate with type t := tval validate_lbound : min:t Base.Maybe_bound.t ‑> t Base.Validate.checkval validate_ubound : max:t Base.Maybe_bound.t ‑> t Base.Validate.checkval validate_bound : min:t Base.Maybe_bound.t ‑> max:t Base.Maybe_bound.t ‑> t Base.Validate.checkmodule Replace_polymorphic_compare : Core_kernel__.Comparable_intf.Polymorphic_compare with type t := tinclude Core_kernel__.Comparable_intf.Map_and_set_binable with type t := t with type comparator_witness := comparator_witnessinclude Core_kernel.Comparator.S with type t := tval comparator : (t, comparator_witness) Core_kernel.Comparator.comparatormodule Map : Core_kernel.Map.S_binable with type Key.t = t with type Key.comparator_witness = comparator_witnessmodule Set : Core_kernel.Set.S_binable with type Elt.t = t with type Elt.comparator_witness = comparator_witnessinclude Core_kernel.Hashable.S_binable with type t := tinclude sig ... endval hash_fold_t : Base.Hash.state ‑> t ‑> Base.Hash.stateval hash : t ‑> Base.Hash.hash_valueval hashable : t Core_kernel.Hashtbl.Hashable.tmodule Table : Core_kernel.Hashtbl.S_binable with type key = tmodule Hash_set : Core_kernel.Hash_set.S_binable with type elt = tmodule Hash_queue : Core_kernel.Hash_queue.S with type Key.t = tval find : string ‑> t optionfind name looks up a t by its name and returns it. This also accepts some
aliases, including:
val find_exn : string ‑> tval local : t Core__.Import.Lazy.tlocal is the machine's local timezone, as determined from the TZ
environment variable or the /etc/localtime file. It is computed from
the state of the process environment and on-disk tzdata database at
some unspecified moment prior to its first use, so its value may be
unpredictable if that state changes during program operation. Arguably,
changing the timezone of a running program is a problematic operation
anyway -- most people write code assuming the clock doesn't suddenly
jump several hours without warning.
Note that any function using this timezone can throw an exception if
the TZ environment variable is misconfigured or if the appropriate
timezone files can't be found because of the way the box is configured.
We don't sprinkle _exn all over all the names in this module because
such misconfiguration is quite rare.
val likely_machine_zones : string list Core__.Import.reflikely_machine_zones is a list of zone names that will be searched
first when trying to determine the machine zone of a box. Setting this
to a likely set of zones for your application will speed the very first
use of the local timezone.
val of_utc_offset : hours:int ‑> tof_utc_offset offset returns a timezone with a static UTC offset (given in
hours).
val initialized_zones : unit ‑> (string * t) listinitialized_zones () returns a sorted list of time zone names that have
been loaded from disk thus far.
The functions below are lower level and should be used more rarely.
module Stable : sig ... end