Module type Core_kernel__.Zone.S

module Time : Core_kernel__.Time0_intf.S

User-friendly interface

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

include sig ... end
val compare : t ‑> t ‑> Core_kernel__.Import.int
val sexp_of_t : t ‑> Sexplib.Sexp.t
val input_tz_file : zonename:Core_kernel__.Import.string ‑> filename:Core_kernel__.Import.string ‑> t

input_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.ref

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.

val of_utc_offset : hours:Core_kernel__.Import.int ‑> t

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

val utc : t

utc the UTC time zone. Included for convenience

val abbreviation : t ‑> Time.t ‑> Core_kernel__.Import.string

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.

val name : t ‑> Core_kernel__.Import.string
val original_filename : t ‑> Core_kernel__.Import.string Core_kernel__.Import.option

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

val digest : t ‑> Core_kernel__.Import.string Core_kernel__.Import.option

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

val shift_epoch_time : t ‑> [ `Local | `UTC ] ‑> Time.t ‑> Time.t

shift_epoch_time zone [`Local | `UTC] time Takes an epoch (aka "unix") time given either in local or in UTC (as indicated in the arguments) and shifts it according to the local time regime in force in zone. That is, given a Local epoch time it will return the corresponding UTC timestamp and vice versa. This function is low level, and is not intended to be called by most client code. Use the high level functions provided in Time instead.

val next_clock_shift : t ‑> after:Time.t ‑> (Time.t * Time.Span.t) Core_kernel__.Import.option

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.

val prev_clock_shift : t ‑> before:Time.t ‑> (Time.t * Time.Span.t) Core_kernel__.Import.option

As next_clock_shift, but strictly *before* the given time.