Calendar v0.18.0 Calendar.TimeZoneData View Source
Deprecated: use the Tzdata library directly instead
Link to this section 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.
Link to this section Functions
canonical_zone?(name) View Source
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
Deprecated. Use Tzdata.canonical_zone?
instead.
canonical_zone_list() View Source
Like zone_list, but excludes aliases for zones.
Deprecated. Use Tzdata.canonical_zone_list
instead.
leap_seconds() View Source
List of know leap seconds as DateTime structs
Example:
iex> TimeZoneData.leap_seconds |> Enum.take(2)
[%DateTime{zone_abbr: "UTC", day: 30, hour: 23, minute: 59, month: 6, second: 60, std_offset: 0, time_zone: "Etc/UTC", microsecond: {0, 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, 0}, utc_offset: 0, year: 1972}]
Deprecated. Use Tzdata.leap_seconds |> Enum.map(&Calendar.NaiveDateTime.from_erl!/1) |> Enum.map(&(DateTime.from_naive!(&1, "Etc/UTC")))
instead.
leap_seconds_erl() View Source
List of known leap seconds in erlang tuple format in UTC.
Example:
iex> TimeZoneData.leap_seconds_erl |> Enum.take(2)
[{{1972, 6, 30}, {23, 59, 60}}, {{1972, 12, 31}, {23, 59, 60}}]
Deprecated. Use Tzdata.leap_seconds
instead.
links() View Source
Returns a map of links. Also known as aliases.
iex> Calendar.TimeZoneData.links["Europe/Jersey"]
"Europe/London"
Deprecated. Use Tzdata.links
instead.
periods(zone_name) View Source
A list of pre-compiled periods for a given zone name.
Deprecated. Use Tzdata.periods(zone_name)
instead.
periods_for_time(zone_name, time_point, time_type \\ :wall) View Source
tzdata_version() View Source
Returns tzdata release version as a string.
Example:
Calendar.TimeZoneData.tzdata_version
"2014i"
Deprecated. Use Tzdata.tzdata_version
instead.
zone_alias?(name) View Source
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
Deprecated. Use Tzdata.zone_alias?
instead.
zone_alias_list() View Source
A list of aliases for zone names. For instance Europe/Jersey is an alias for Europe/London. Aliases are also known as linked zones.
Deprecated. Use Tzdata.zone_alias_list
instead.
zone_exists?(name) View Source
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
Deprecated. Use Tzdata.zone_exists?
instead.
zone_list() View Source
zone_list provides a list of all the zone names that can be used with DateTime. This includes aliases.
Deprecated. Use Tzdata.zone_list
instead.
zone_lists_grouped() View Source
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.
Deprecated. Use Tzdata.zone_lists_grouped
instead.