package core

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

Module Time.ZoneSource

User-friendly interface

Sourcetype t

The 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.

Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Comparable.S with type t := t
Sourceval compare : t -> t -> int
Sourceval input_tz_file : zonename:Base.String.t -> filename:Base.String.t -> t

input_tz_file ~zonename ~filename read in filename and return t with name t = zonename

Sourceval likely_machine_zones : Base.String.t Base.List.t Base.Ref.t

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.

Sourceval of_utc_offset : hours:Base.Int.t -> t

of_utc_offset offset returns a timezone with a static UTC offset (given in hours).

Sourceval of_utc_offset_explicit_name : name:Base.String.t -> hours:Base.Int.t -> t
Sourceval utc : t

utc the UTC time zone. Included for convenience

Sourceval name : t -> Base.String.t
Sourceval original_filename : t -> Base.String.t Base.Option.t

original_filename t return the filename t was loaded from (if any)

Sourceval digest : t -> Md5.t Base.Option.t

digest t return the MD5 digest of the file the t was created from (if any)

Sourceval reset_transition_cache : t -> Base.Unit.t

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.

Sourcemodule Index : sig ... end

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.

Sourceval index : t -> Base.Float.t -> Index.t

Gets the index of a time.

Sourceval index_of_date_and_ofday : t -> Base.Float.t -> Index.t
Sourceval index_offset_from_utc_exn : t -> Index.t -> Base.Float.t

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.

Sourceval index_abbreviation_exn : t -> Index.t -> Base.String.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.

Sourceval index_has_prev_clock_shift : t -> Index.t -> Base.Bool.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.

Sourceval index_prev_clock_shift_time_exn : t -> Index.t -> Base.Float.t
Sourceval index_prev_clock_shift_amount_exn : t -> Index.t -> Base.Float.t
Sourceval index_has_next_clock_shift : t -> Index.t -> Base.Bool.t
Sourceval index_next_clock_shift_time_exn : t -> Index.t -> Base.Float.t
Sourceval index_next_clock_shift_amount_exn : t -> Index.t -> Base.Float.t
Sourceval abbreviation : t -> Base.Float.t -> Base.String.t

abbreviation t time returns the abbreviation name (such as EDT, EST, JST) of given zone t at time. 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.

Sourceval absolute_time_of_date_and_ofday : t -> Base.Float.t -> Base.Float.t

absolute_time_of_date_and_ofday and date_and_ofday_of_absolute_time convert between absolute times and date + ofday forms. These are low level functions not intended for most clients. These functions read and write the zone's cached index.

Sourceval date_and_ofday_of_absolute_time : t -> Base.Float.t -> Base.Float.t
Sourceval next_clock_shift : t -> strictly_after:Base.Float.t -> (Base.Float.t * Base.Float.t) Base.Option.t

Takes a Time.t and returns the next Time.t strictly after it, if any, that the time zone UTC offset changes, and by how much it does so.

Sourceval prev_clock_shift : t -> at_or_before:Base.Float.t -> (Base.Float.t * Base.Float.t) Base.Option.t

As next_clock_shift, but *at or before* the given time.

Sourcemodule Hash_queue : sig ... end
Sourcemodule Hash_set : sig ... end
Sourcemodule Map : sig ... end
Sourcemodule Set : sig ... end
Sourcemodule Table : sig ... end
Sourceval (<) : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval (<=) : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval (<>) : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval (=) : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval (>) : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval (>=) : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval __bin_read_t__ : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval arg_type : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval ascending : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval between : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_read_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_reader_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_shape_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_size_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_write_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval bin_writer_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval clamp : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval clamp_exn : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval comparator : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval descending : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval equal : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval find : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval find_exn : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval hash : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval hash_fold_t : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval hashable : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval init : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval initialized_zones : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval local : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval max : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval min : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval of_string : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval pp : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval t_of_sexp : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval to_string : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval validate_bound : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval validate_lbound : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
Sourceval validate_ubound : [ `Use_Time_unix ]
  • deprecated [since 2021-03] Use [Time_unix]
OCaml

Innovation. Community. Security.