package timedesc

  1. Overview
  2. Docs

Module Timedesc.Time_zoneSource

Sourcetype t
Sourceval make : string -> t option

Makes a time zone from name.

Naming follows the convention used in /usr/share/zoneinfo/posix/ distributed on Linux, e.g. "Australia/Sydney".

See available_time_zones for checking usable time zone names at runtime.

Alternatively, if you are using timedesc.tzdb.full (the default implementation for timedesc.tzdb), then you can also see available-time-zones.txt for available time zones.

make handles names with "UTC" prefix specially, following holds regardless of DB backend chosen

  • UTC is alway interpreted as utc
  • UTC+/-offset is always interpreted as call to make_offset_only with the provided signed offset
    • e.g. "UTC+1:30" is equivalent to make_offset_only (Span.For_human.make_exn ~hours:1 ~minutes:30 ())
    • offset may be single/double digit hour, optionally followed by colon and single/double digit minute
Sourceval make_exn : string -> t
Sourceval name : t -> string
Sourceval utc : t
Sourceval local : unit -> t option
Sourceval local_exn : unit -> t
Sourceval equal : t -> t -> bool
Sourceval available_time_zones : string list
Sourceval make_offset_only : Span.t -> t option

This is mainly used for when you only have an offset to work with, and you don't need to do any accurate search over time zones.

One use of this is to create a time zone for to_string functions.

Returns None when offset exceeds 24 hours in size.

Sourceval make_offset_only_exn : Span.t -> t
Sourceval to_fixed_offset_from_utc : t -> Span.t option

Importing and exporting

type entry = {
  1. is_dst : bool;
  2. offset : int;
}
Sourcemodule Raw : sig ... end
Sourcemodule Sexp : sig ... end
Sourcemodule JSON : sig ... end
Sourcemodule Db : sig ... end
OCaml

Innovation. Community. Security.