View Source Cldr.Timezone (Cldr v2.37.5)
Functions to map between the CLDR short time zone code and the IANA timezone names.
The Unicode locale extension U allows the specification of the time zone requested for the provided locale.
This short timezone codes never change even if the IANA names change over time. Therefore these short codes are always stable between CLDR releases.
Summary
Functions
Returns a :{:ok, list}
where list is a
list of IANA timezone names for
a given CLDR short zone code. If no such
short code exists then :error
is returned.
Returns a list of IANA time zone names for
a given CLDR short zone code, or nil
Returns a mapping of CLDR short zone codes to IANA timezone names.
Returns a mapping of territories to their known IANA timezone names.
Functions
Returns a :{:ok, list}
where list is a
list of IANA timezone names for
a given CLDR short zone code. If no such
short code exists then :error
is returned.
Example
iex> Cldr.Timezone.fetch("ausyd")
{:ok,
["Australia/Sydney", "Australia/ACT", "Australia/Canberra", "Australia/NSW"]}
iex> Cldr.Timezone.fetch("nope")
:error
Returns a list of IANA time zone names for
a given CLDR short zone code, or nil
Examples
iex> Cldr.Timezone.fetch("ausyd")
["Australia/Sydney", "Australia/ACT", "Australia/Canberra", "Australia/NSW"]}
iex> Cldr.Timezone.fetch("nope")
nil
@spec timezones() :: map()
Returns a mapping of CLDR short zone codes to IANA timezone names.
@spec timezones_for_territory() :: map()
Returns a mapping of territories to their known IANA timezone names.