time_zone_info v0.1.1 TimeZoneInfo.IanaParser View Source

The IANA-Parser builds the data structure for TimeZoneInfo.

The format of the IANA data explains the article How to Read the tz Database Source Files

Link to this section Summary

Types

The raw IANA data.

The parsed data.

Functions

Builds the data structure IanaParser.output from the iana_data.

Builds the data structure IanaParser.output from the IANA data in files under path.

Link to this section Types

The raw IANA data.

Link to this type

day()

View Source
day() ::
  non_neg_integer()
  | [{:last_day_of_week, Calendar.day_of_week()}]
  | [day: Calendar.day(), op: op(), day_of_week: Calendar.day_of_week()]
Link to this type

op()

View Source
op() :: :ge | :le
Link to this type

output()

View Source
output() :: %{
  optional(:zones) => %{required(Calendar.time_zone()) => [zone()]},
  optional(:rules) => %{required(TimeZoneInfo.rule_name()) => [rule()]},
  optional(:links) => %{required(Calendar.time_zone()) => Calendar.time_zone()}
}

The parsed data.

Link to this type

rule()

View Source
rule() :: [
  from: Calendar.year(),
  to: Calendar.year() | :only,
  in: Calendar.month(),
  on: day(),
  at: time(),
  time_standard: TimeZoneInfo.time_standard(),
  std_offset: Calendar.std_offset(),
  letters: String.t() | nil
]
Link to this type

zone()

View Source
zone() :: [
  utc_offset: Calendar.utc_offset(),
  rules: String.t() | integer() | nil,
  format: TimeZoneInfo.zone_abbr_format(),
  until: until(),
  time_standard: TimeZoneInfo.time_standard()
]

Link to this section Functions

Link to this function

parse(iana_data)

View Source
parse(data()) :: {:ok, output()} | {:error, rest, line, byte_offset}
when rest: String.t(), line: non_neg_integer(), byte_offset: non_neg_integer()

Builds the data structure IanaParser.output from the iana_data.

Link to this function

parse(path, files)

View Source
parse(Path.t(), String.t()) ::
  {:ok, output()} | {:error, rest, line, byte_offset}
when rest: String.t(), line: non_neg_integer(), byte_offset: non_neg_integer()

Builds the data structure IanaParser.output from the IANA data in files under path.