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
time
is aTime
struct or any map that contains at least the:zone_abbr
,:utc_offset
and:std_offset
keys of the format used byTime
n
is the specific non-location timezone format and is in the range1..4
locale
is any valid locale name returned byCldr.known_locale_names/0
or aCldr.LanguageTag
struct. The default isCldr.get_locale/0
options
is aKeyword
list 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()}