Cldr.DateTime.Formatter.zone_iso_z

You're seeing just the function zone_iso_z, go back to Cldr.DateTime.Formatter module for more information.
Link to this function

zone_iso_z(zone_iso_z, n \\ 1, options \\ [])

View Source

Specs

zone_iso_z(Calendar.time(), integer(), Keyword.t()) ::
  String.t() | {:error, String.t()}

Returns the ISO zone offset (format symbol X) part of a DateTime or Time,

This is the ISO8601 format with hours, minutes and optional seconds fields with "Z" as the identifier if the timezone offset is 0.

Arguments

Format Symbol

The representation of the timezone offset is made in accordance with the following table:

SymbolResultsDescription
X"+01"ISO8601 Basic Format with hours and optional minutes or "Z"
XX"+0100"ISO8601 Basic Format with hours and minutes or "Z"
XXX"+0100"ISO8601 Basic Format with hours and minutes, optional seconds or "Z"
XXXX"+010059"ISO8601 Basic Format with hours and minutes, optional seconds or "Z"
XXXXX"+01:00:10"ISO8601 Extended Format with hours and minutes, optional seconds or "Z"

Examples

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 3610, std_offset: 0}, 1
"+01"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 3610, std_offset: 0}, 2
"+0100"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 3610, std_offset: 0}, 3
"+01:00:10"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 3610, std_offset: 0}, 4
"+010010"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 3610, std_offset: 0}, 5
"+01:00:10"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 0, std_offset: 0}, 5
"Z"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 0, std_offset: 0}, 4
"Z"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 0, std_offset: 0}, 3
"Z"

iex> Cldr.DateTime.Formatter.zone_iso_z %{time_zone: "Etc/UTC",
...>   utc_offset: 0, std_offset: 0}, 2
"Z"
Link to this function

zone_iso_z(time, n, locale, backend, options \\ [])

View Source

Specs

zone_iso_z(Calendar.time(), integer(), locale(), Cldr.backend(), Keyword.t()) ::
  String.t() | {:error, String.t()}