TimezoneSourceinclude Core.Core_private.Time_zone.S with type t = Core.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.
include Ppx_compare_lib.Comparable.S with type t := tinput_tz_file ~zonename ~filename read in filename and return t with name t = zonename
likely_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.
of_utc_offset offset returns a timezone with a static UTC offset (given in hours).
original_filename t return the filename t was loaded from (if any)
digest t return the MD5 digest of the file the t was created from (if any)
For 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.
A 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.
Gets the index of a time.
Gets 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.
index_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.
Accessors 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.
include Extend_zone with type t := tinclude Core.Identifiable.S with type t := tinclude Bin_prot.Binable.S with type t := tinclude Bin_prot.Binable.S_only_functions with type t := tThis function only needs implementation if t exposed to be a polymorphic variant. Despite what the type reads, this does *not* produce a function after reading; instead it takes the constructor tag (int) before reading and reads the rest of the variant t afterwards.
include Ppx_hash_lib.Hashable.S with type t := tinclude Sexplib0.Sexpable.S with type t := tinclude Ppx_compare_lib.Comparable.S with type t := tinclude Ppx_hash_lib.Hashable.S with type t := tinclude Core.Comparable.S_binable with type t := tinclude Base.Comparable.S with type t := tcompare t1 t2 returns 0 if t1 is equal to t2, a negative integer if t1 is less than t2, and a positive integer if t1 is greater than t2.
ascending 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 comparator : (t, comparator_witness) Base__.Comparator.comparatormodule Map :
Core.Map.S_binable
with type Key.t = t
with type Key.comparator_witness = comparator_witnessmodule Set :
Core.Set.S_binable
with type Elt.t = t
with type Elt.comparator_witness = comparator_witnessfind name looks up a t by its name and returns it. This also accepts some aliases, including:
local 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.
initialized_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.
init () pre-load all available time zones from disk, this function has no effect if it is called multiple times. Time zones will otherwise be loaded at need from the disk on the first call to find/find_exn.