View Source TimeZoneInfo.DataStore behaviour (TimeZoneInfo v0.6.1)

A behaviour to store data and serve them later on.

Link to this section Summary

Callbacks

Deletes all data in the data store.

Returns true if the DataSore is empty.

Returns rules for a given rule_name.

Returns the list of all available time zones with or without links. The option :links can be used to customize the list.

Returns the transitions for a given time_zone.

Returns infos about the data store.

Puts the given data into the store.

Returns the version of the IANA database from which the data was generated.

Link to this section Callbacks

Specs

delete!() :: :ok

Deletes all data in the data store.

Specs

empty?() :: boolean()

Returns true if the DataSore is empty.

Specs

get_rules(rule_name :: TimeZoneInfo.rule_name()) ::
  {:ok, rules :: [TimeZoneInfo.rule()]} | {:error, :rule_not_found}

Returns rules for a given rule_name.

Specs

get_time_zones([{:links, :ignore | :only | :include}]) :: [Calendar.time_zone()]

Returns the list of all available time zones with or without links. The option :links can be used to customize the list.

Values for :links:

  • :ignore just the time zone names will be returned
  • :only just the link name will be returned
  • :include the time zone and link names will be returned

The list will be sorted.

Link to this callback

get_transitions(time_zone)

View Source

Specs

get_transitions(time_zone :: Calendar.time_zone()) ::
  {:ok, transitions :: [TimeZoneInfo.transition()]}
  | {:error, :transitions_not_found}

Returns the transitions for a given time_zone.

Specs

info() :: term()

Returns infos about the data store.

Specs

put(data :: TimeZoneInfo.data()) :: :ok | :error

Puts the given data into the store.

Specs

version() :: String.t() | nil

Returns the version of the IANA database from which the data was generated.