View Source Cldr.Timezone (Cldr v2.38.0)

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

@spec fetch(String.t()) :: {:ok, [String.t()]} | :error

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
Link to this function

get(short_zone, default \\ nil)

View Source
@spec get(String.t(), String.t() | nil) :: [String.t()] | nil

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() :: %{
  required(zone_name :: String.t()) => [iana_name :: String.t(), ...]
}

Returns a mapping of CLDR short zone codes to IANA timezone names.

Link to this function

timezones_for_territory()

View Source
@spec timezones_for_territory() :: %{
  JE: [String.t(), ...],
  NP: [String.t(), ...],
  GD: [String.t(), ...],
  GL: [String.t(), ...],
  IT: [String.t(), ...],
  GQ: [String.t(), ...],
  FR: [String.t(), ...],
  NC: [String.t(), ...],
  UG: [String.t(), ...],
  PK: [String.t(), ...],
  LA: [String.t(), ...],
  GA: [String.t(), ...],
  HU: [String.t(), ...],
  WF: [String.t(), ...],
  BM: [String.t(), ...],
  AR: [String.t(), ...],
  DJ: [String.t(), ...],
  LS: [String.t(), ...],
  SN: [String.t(), ...],
  KZ: [String.t(), ...],
  AZ: [String.t(), ...],
  PR: [String.t(), ...],
  TR: [String.t(), ...],
  ME: [String.t(), ...],
  DK: [String.t(), ...],
  MZ: [String.t(), ...],
  GB: [String.t(), ...],
  TW: [String.t(), ...],
  PH: [String.t(), ...],
  GM: [String.t(), ...],
  SC: [String.t(), ...],
  AS: [String.t(), ...],
  EE: [String.t(), ...],
  YE: [String.t(), ...],
  GY: [String.t(), ...],
  TN: [String.t(), ...],
  MC: [String.t(), ...],
  SY: [String.t(), ...],
  BR: [String.t(), ...],
  LT: [String.t(), ...],
  GR: [String.t(), ...],
  GP: [String.t(), ...],
  FI: [String.t(), ...],
  NI: [String.t(), ...],
  AO: [String.t(), ...],
  TV: [String.t(), ...],
  GH: [String.t(), ...],
  TO: [String.t(), ...],
  PM: [String.t(), ...],
  ES: [String.t(), ...],
  FJ: [String.t(), ...],
  TH: [String.t(), ...],
  VG: [String.t(), ...],
  KR: [String.t(), ...],
  ZM: [String.t(), ...],
  HN: [String.t(), ...],
  SS: [String.t(), ...],
  GF: [String.t(), ...],
  SH: [String.t(), ...],
  AI: [String.t(), ...],
  BG: [String.t(), ...],
  SZ: [String.t(), ...],
  CW: [String.t(), ...],
  GE: [String.t(), ...],
  MT: [String.t(), ...],
  CI: [String.t(), ...],
  GU: [String.t(), ...],
  HK: [String.t(), ...],
  AL: [String.t(), ...],
  BE: [String.t(), ...],
  MU: [String.t(), ...],
  RW: [String.t(), ...],
  UY: [String.t(), ...],
  PG: [String.t(), ...],
  BY: [String.t(), ...],
  FO: [String.t(), ...],
  TM: [String.t(), ...],
  MX: [String.t(), ...],
  RU: [String.t(), ...],
  AQ: [String.t(), ...],
  UZ: [String.t(), ...],
  IE: [String.t(), ...],
  ZA: [String.t(), ...],
  CO: [String.t(), ...],
  KP: [String.t(), ...],
  KE: [String.t(), ...],
  SG: [String.t(), ...],
  IR: [String.t(), ...],
  PW: [String.t(), ...],
  DE: [String.t(), ...],
  MD: [String.t(), ...],
  BZ: [String.t(), ...],
  CH: [String.t(), ...],
  TJ: [String.t(), ...],
  BB: [String.t(), ...],
  CR: [String.t(), ...],
  WS: [String.t(), ...],
  TG: [String.t(), ...],
  GI: [String.t(), ...],
  CY: [String.t(), ...],
  ST: [String.t(), ...],
  BF: [String.t(), ...],
  AT: [String.t(), ...],
  KW: [String.t(), ...],
  GT: [String.t(), ...],
  BJ: [String.t(), ...],
  VU: [String.t(), ...],
  FK: [String.t(), ...],
  SR: [String.t(), ...],
  MM: [String.t(), ...],
  CN: [String.t(), ...],
  PT: [String.t(), ...],
  DM: [String.t(), ...],
  PE: [String.t(), ...],
  JM: [String.t(), ...],
  NE: [String.t(), ...],
  RO: [String.t(), ...],
  VE: [String.t(), ...],
  TF: [String.t(), ...],
  PN: [String.t(), ...],
  VI: [String.t(), ...],
  IN: [String.t(), ...],
  EH: [String.t(), ...],
  MO: [String.t(), ...],
  SI: [String.t(), ...],
  NL: [String.t(), ...],
  BH: [String.t(), ...],
  AD: [String.t(), ...],
  BT: [String.t(), ...],
  IQ: [String.t(), ...],
  KH: [String.t(), ...],
  BQ: [String.t(), ...],
  CX: [String.t(), ...],
  LY: [String.t(), ...],
  NF: [String.t(), ...],
  TK: [String.t(), ...],
  NA: [String.t(), ...],
  IS: [String.t(), ...],
  FM: [String.t(), ...],
  CU: [String.t(), ...],
  BA: [String.t(), ...],
  ML: [String.t(), ...],
  GW: [String.t(), ...],
  SD: [String.t(), ...],
  KN: [String.t(), ...],
  MW: [String.t(), ...],
  VA: [String.t(), ...],
  CL: [String.t(), ...],
  PS: [String.t(), ...],
  SL: [String.t(), ...],
  NO: [String.t(), ...],
  TZ: [String.t(), ...],
  QA: [String.t(), ...],
  NG: [String.t(), ...],
  MR: [String.t(), ...],
  AU: [String.t(), ...],
  MS: [String.t(), ...],
  UN: [String.t(), ...],
  UA: [String.t(), ...],
  TD: [String.t(), ...],
  GG: [String.t(), ...],
  CF: [String.t(), ...],
  EG: [String.t(), ...],
  NU: [String.t(), ...],
  LI: [String.t(), ...],
  CM: [String.t(), ...],
  BI: [String.t(), ...],
  SX: [String.t(), ...],
  SE: [String.t(), ...],
  SM: [String.t(), ...],
  PA: [String.t(), ...],
  NZ: [String.t(), ...],
  BO: [String.t(), ...],
  LC: [String.t(), ...],
  KG: [String.t(), ...],
  LK: [String.t(), ...],
  CG: [String.t(), ...],
  RS: [String.t(), ...],
  TC: [String.t(), ...],
  MQ: [String.t(), ...],
  ID: [String.t(), ...],
  ER: [String.t(), ...],
  AF: [String.t(), ...],
  LB: [String.t(), ...],
  ZW: [String.t(), ...],
  PF: [String.t(), ...],
  LU: [String.t(), ...],
  EC: [String.t(), ...],
  SB: [String.t(), ...],
  US: [String.t(), ...],
  CD: [String.t(), ...],
  SA: [String.t(), ...],
  CZ: [String.t(), ...],
  MN: [String.t(), ...],
  SJ: [String.t(), ...],
  BD: [String.t(), ...],
  MP: [String.t(), ...],
  ET: [String.t(), ...],
  MG: [String.t(), ...],
  MA: [String.t(), ...],
  NR: [String.t(), ...],
  LR: [String.t(), ...],
  MH: [String.t(), ...],
  MY: [String.t(), ...],
  AM: [String.t(), ...],
  JO: [String.t(), ...],
  BW: [String.t(), ...],
  PL: [String.t(), ...],
  IO: [String.t(), ...],
  SK: [String.t(), ...],
  AW: [String.t(), ...],
  CK: [String.t(), ...],
  AG: [String.t(), ...],
  VC: [String.t(), ...],
  KI: [String.t(), ...],
  BS: [String.t(), ...],
  GS: [String.t(), ...],
  PY: [String.t(), ...],
  HR: [String.t(), ...],
  BN: [String.t(), ...],
  MK: [String.t(), ...],
  VN: [String.t(), ...],
  CA: [String.t(), ...],
  KM: [String.t(), ...],
  DZ: [String.t(), ...],
  GN: [String.t(), ...],
  HT: [String.t(), ...],
  TT: [String.t(), ...],
  MV: [String.t(), ...],
  RE: [String.t(), ...],
  OM: [String.t(), ...],
  SO: [String.t(), ...],
  CC: [String.t(), ...],
  TL: [String.t(), ...],
  CV: [String.t(), ...],
  YT: [String.t(), ...],
  LV: [String.t(), ...],
  KY: [String.t(), ...],
  AE: [String.t(), ...],
  DO: [String.t(), ...],
  SV: [String.t(), ...],
  IM: [String.t(), ...],
  UM: [String.t(), ...],
  JP: [String.t(), ...]
}

Returns a mapping of territories to their known IANA timezone names.