time_zone_info v0.1.0 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
data()
View Sourcedata() :: %{ 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
.
The number of gregorian seconds starting with year 0
The letter in an IANA rule.
rule()
View Sourcerule() :: {{Calendar.month(), TimeZoneInfo.IanaParser.day(), Calendar.hour(), Calendar.minute(), Calendar.second()}, time_standard(), Calendar.std_offset(), letter()}
A rule representation.
The name of a rule set that can be found in the IANA data.
rules_ref()
View Sourcerules_ref() :: {Calendar.utc_offset(), rule_name(), zone_abbr_format()}
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
.
time_standard()
View Sourcetime_standard() :: :wall | :standard | :gmt | :utc | :zulu
The time standards used by IANA.
time_zone_period()
View Sourcetime_zone_period() :: {Calendar.utc_offset(), Calendar.std_offset(), Calendar.zone_abbr()}
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.
The format of a zone_abbr
.
The zone_state
is either a timezone_period
or a rules_ref
.
Link to this section 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.
state()
View Sourcestate() :: :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.
time_zones(opts \\ [links: :include])
View Sourcetime_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.
update(opt \\ :run)
View Sourceupdate(opt :: :run | :force) :: :ok | {:next, non_neg_integer()} | {:error, term()}
Triggers the update process. Withe the opt
:force
the update will be
forced.