Cldr.DateTime.Formatter.zone_short
zone_short, go back to Cldr.DateTime.Formatter module for more information.
Specs
zone_short(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the specific non-location format of a timezone (format symbol z)
from a DateTime or Time.
Since Elixir does not provide full time zone support, we return here only
the :time_zone element of the provided DateTime or other struct without
any localization.
Arguments
timeis aTimestruct or any map that contains at least the:zone_abbr,:utc_offsetand:std_offsetkeys of the format used byTimenis the specific non-location timezone format and is in the range1..4localeis any valid locale name returned byCldr.known_locale_names/0or aCldr.LanguageTagstruct. The default isCldr.get_locale/0optionsis aKeywordlist of options. There are no options used inzone_short/4
Format Symbol
The representation of the timezone is made in accordance with the following
table:
| Symbol | Results | Description |
|---|---|---|
| z..zzz | "UTC" | :zone_abbr key, unlocalised |
| zzzz | "GMT" | Delegates to zone_gmt/4 |
Examples
iex> Cldr.DateTime.Formatter.zone_short %{zone_abbr: "UTC",
...> utc_offset: 0, std_offset: 0}, 1
"UTC"
iex> Cldr.DateTime.Formatter.zone_short %{zone_abbr: "UTC",
...> utc_offset: 0, std_offset: 0}, 4
"GMT"
Specs
zone_short(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}