time_zone_info v0.1.1 TimeZoneInfo View Source

TimeZoneInfo provides a time zone database for Elixir using the data from the the Internet Assigned Numbers Authority (IANA).

Therefore TimeZoneInfo contains an implementation of the Calendar.TimeZoneDatabase behaviour under TimeZoneInfo.TimeZoneDatabase.

Link to this section Summary

Types

The data structure containing all informations for TimeZoneInfo.

The number of gregorian seconds starting with year 0

The letter in an IANA rule.

A rule representation.

The name of a rule set that can be found in the IANA data.

A reference to a rule set. The reference also contains utc_offset and format, The reference contains utc_offset and format because these values are needed to apply a rule.

The time standards used by IANA.

A period where a certain combination of UTC offset, standard offset and zone abbreviation is in effect.

A transition marks a point in time when one or more of the values utc-offset, std_offset or zone-abbr change.

The format of a zone_abbr.

The zone_state is either a timezone_period or a rules_ref.

Functions

Returns the version of the IANA database.

Returns the date time in UTC for the next update. Retruns :never if the automated update disabled.

Returns the state of TimeZoneInfo.

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

Triggers the update process. Withe the opt :force the update will be forced.

Link to this section Types

Link to this type

data()

View Source
data() :: %{
  version: String.t(),
  time_zones: %{required(Calendar.time_zone()) => [transition()]},
  rules: %{required(rule_name()) => [rule()]},
  links: %{required(Calendar.time_zone()) => Calendar.time_zone()}
}

The data structure containing all informations for TimeZoneInfo.

Link to this type

gregorian_seconds()

View Source
gregorian_seconds() :: non_neg_integer()

The number of gregorian seconds starting with year 0

The letter in an IANA rule.

A rule representation.

Link to this type

rule_name()

View Source
rule_name() :: String.t()

The name of a rule set that can be found in the IANA data.

A reference to a rule set. The reference also contains utc_offset and format, The reference contains utc_offset and format because these values are needed to apply a rule.

Link to this type

time_standard()

View Source
time_standard() :: :wall | :standard | :gmt | :utc | :zulu

The time standards used by IANA.

A period where a certain combination of UTC offset, standard offset and zone abbreviation is in effect.

This is equivalent to Calendar.TimeZoneDatabase.time_zone_period.t().

A transition marks a point in time when one or more of the values utc-offset, std_offset or zone-abbr change.

Link to this type

zone_abbr_format()

View Source
zone_abbr_format() ::
  {:string, String.t()} | {:template, String.t()} | {:choice, [String.t()]}

The format of a zone_abbr.

The zone_state is either a timezone_period or a rules_ref.

Link to this section Functions

Link to this function

iana_version()

View Source
iana_version() :: String.t()

Returns the version of the IANA database.

Link to this function

next_update()

View Source
next_update() :: DateTime.t() | :never | :error

Returns the date time in UTC for the next update. Retruns :never if the automated update disabled.

Link to this function

state()

View Source
state() :: :ok | {:next, non_neg_integer()} | {:error, term()}

Returns the state of TimeZoneInfo.

Returns

  • :ok if everything runs normal and the automated update is disabled.
  • {:next, seconds} if everything runs normal.
  • {:error, reason} in case of an error.
Link to this function

time_zones(opts \\ [links: :include])

View Source
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 names will be returned
  • :include the time zone and link names will be returned (default)

The list will be sorted.

Link to this function

update(opt \\ :run)

View Source
update(opt :: :run | :force) ::
  :ok | {:next, non_neg_integer()} | {:error, term()}

Triggers the update process. Withe the opt :force the update will be forced.