Cldr.DateTime.Formatter.zone_gmt
You're seeing just the function
zone_gmt
, go back to Cldr.DateTime.Formatter module for more information.
Specs
zone_gmt(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the short localised GMT offset (format symbol O
) part of a
DateTime
or Time
.
Arguments
time
is aTime
struct or any map that contains at least the: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_gmt/4
Format Symbol
The representation of the GMT offset
is made in accordance with the following
table:
Symbol | Results | Description |
---|---|---|
O | "GMT+1" | Short localised GMT format |
OOOO | "GMT+01:00" | Long localised GMT format |
Examples
iex> Cldr.DateTime.Formatter.zone_gmt %{time_zone: "Etc/UTC",
...> utc_offset: 3610, std_offset: 0}, 1
"GMT+1"
iex> Cldr.DateTime.Formatter.zone_gmt %{time_zone: "Etc/UTC",
...> utc_offset: 3610, std_offset: 0}, 4
"GMT+01:00"
Specs
zone_gmt(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}