Cldr.Timezone (Cldr v2.31.0) View Source
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.
Link to this section 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.
Link to this section Functions
Specs
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
Specs
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
Specs
timezones() :: map()
Returns a mapping of CLDR short zone codes to IANA timezone names.
Specs
timezones_for_territory() :: map()
Returns a mapping of territories to their known IANA timezone names.