Cldr.DateTime.Formatter.zone_basic
zone_basic
, go back to Cldr.DateTime.Formatter module for more information.
Specs
zone_basic(Calendar.time(), integer(), Keyword.t()) :: String.t() | {:error, String.t()}
Returns the basic zone offset (format symbol Z
) part of a DateTime
or Time
,
The ISO8601 basic format with hours, minutes and optional seconds fields. The format is equivalent to RFC 822 zone format (when optional seconds field is absent). This is equivalent to the "xxxx" specifier.
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_basic/4
Format Symbol
The representation of the timezone
is made in accordance with the following
table:
Symbol | Results | Description |
---|---|---|
Z..ZZZ | "+0100" | ISO8601 Basic Format with hours and minutes |
ZZZZ | "+01:00" | Delegates to `zone_gmt/4 |
ZZZZZ | "+01:00:10" | ISO8601 Extended format with optional seconds |
Examples
iex> Cldr.DateTime.Formatter.zone_basic %{time_zone: "Etc/UTC",
...> utc_offset: 3600, std_offset: 0}, 1
"+0100"
iex> Cldr.DateTime.Formatter.zone_basic %{time_zone: "Etc/UTC",
...> utc_offset: 3610, std_offset: 0}, 4
"GMT+01:00"
iex> Cldr.DateTime.Formatter.zone_basic %{time_zone: "Etc/UTC",
...> utc_offset: 0, std_offset: 0}, 5
"Z"
iex> Cldr.DateTime.Formatter.zone_basic %{time_zone: "Etc/UTC",
...> utc_offset: 3610, std_offset: 0}, 5
"+01:00:10"
Specs
zone_basic(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) :: String.t() | {:error, String.t()}