Calendar v0.17.1 Calendar.TimeZoneData
Summary
Functions
Takes the name of a zone. Returns true if zone exists and is canonical. Otherwise false
Like zone_list, but excludes aliases for zones
List of know leap seconds as DateTime structs
List of known leap seconds in erlang tuple format in UTC
Returns a map of links. Also known as aliases
A list of pre-compiled periods for a given zone name
Returns tzdata release version as a string
Takes the name of a zone. Returns true if zone exists and is an alias. Otherwise false
A list of aliases for zone names. For instance Europe/Jersey is an alias for Europe/London. Aliases are also known as linked zones
Takes the name of a zone. Returns true zone exists. Otherwise false
zone_list provides a list of all the zone names that can be used with DateTime. This includes aliases
Returns a map with keys being group names and the values lists of time zone names. The group names mirror the file names used by the tzinfo database
Functions
Takes the name of a zone. Returns true if zone exists and is canonical. Otherwise false.
iex> Calendar.TimeZoneData.canonical_zone? "Europe/London"
true
iex> Calendar.TimeZoneData.canonical_zone? "Europe/Jersey"
false
List of know leap seconds as DateTime structs
Example:
iex> TimeZoneData.leap_seconds |> Enum.take(3)
[%DateTime{zone_abbr: "UTC", day: 31, hour: 23, minute: 59, month: 12, second: 60, std_offset: 0, time_zone: "Etc/UTC", microsecond: 0, utc_offset: 0, year: 1971},
%DateTime{zone_abbr: "UTC", day: 30, hour: 23, minute: 59, month: 6, second: 60, std_offset: 0, time_zone: "Etc/UTC", microsecond: 0, utc_offset: 0, year: 1972},
%DateTime{zone_abbr: "UTC", day: 31, hour: 23, minute: 59, month: 12, second: 60, std_offset: 0, time_zone: "Etc/UTC", microsecond: 0, utc_offset: 0, year: 1972}]
List of known leap seconds in erlang tuple format in UTC.
Example:
iex> TimeZoneData.leap_seconds_erl |> Enum.take(3)
[{{1971, 12, 31}, {23, 59, 60}}, {{1972, 6, 30}, {23, 59, 60}}, {{1972, 12, 31}, {23, 59, 60}}]
Returns a map of links. Also known as aliases.
iex> Calendar.TimeZoneData.links["Europe/Jersey"]
"Europe/London"
Returns tzdata release version as a string.
Example:
Calendar.TimeZoneData.tzdata_version
"2014i"
Takes the name of a zone. Returns true if zone exists and is an alias. Otherwise false.
iex> Calendar.TimeZoneData.zone_alias? "Europe/Jersey"
true
iex> Calendar.TimeZoneData.zone_alias? "Europe/London"
false
A list of aliases for zone names. For instance Europe/Jersey is an alias for Europe/London. Aliases are also known as linked zones.
Takes the name of a zone. Returns true zone exists. Otherwise false.
iex> Calendar.TimeZoneData.zone_exists? "Pacific/Auckland"
true
iex> Calendar.TimeZoneData.zone_exists? "America/Sao_Paulo"
true
iex> Calendar.TimeZoneData.zone_exists? "Europe/Jersey"
true
zone_list provides a list of all the zone names that can be used with DateTime. This includes aliases.