Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file timezone_intf.ml
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182openCore_kernelmoduletypeExtend_zone=sigtypetincludeIdentifiable.Swithtypet:=t(** [find name] looks up a [t] by its name and returns it. This also accepts some
aliases, including:
- chi -> America/Chicago
- nyc -> America/New_York
- hkg -> Asia/Hong_Kong
- lon -> Europe/London
- tyo -> Asia/Tokyo *)valfind:string->toptionvalfind_exn:string->t(** [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. *)vallocal:tLazy.t(** [initialized_zones ()] returns a sorted list of time zone names that have
been loaded from disk thus far. *)valinitialized_zones:unit->(string*t)list(** {3 Low-level functions}
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. *)valinit:unit->unitendmoduletypeTimezone=sigmoduletypeExtend_zone=Extend_zoneincludeCore_kernel_private.Time_zone.Swithtypet=Time.Zone.tincludeExtend_zonewithtypet:=tmoduleStable:sigmoduleV1:sigtypenonrect=t[@@derivingbin_io,compare,hash,sexp]endincludeCore_kernel_private.Time_zone.S_stablewithtypet:=tend(**/**)(*_ See the Jane Street Style Guide for an explanation of [Private] submodules:
https://opensource.janestreet.com/standards/#private-submodules *)modulePrivate:sigmoduleZone_cache:sigtypez={mutablefull:bool;basedir:string;table:Time.Zone.tString.Table.t}valthe_one_and_only:zvalinit:unit->unitvalfind:string->toptionendendend