View Source TimeZoneInfo.IanaParser (TimeZoneInfo v0.7.2)

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

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.

Types

@type data() :: binary()

The raw IANA data.

@type day() ::
  non_neg_integer()
  | [{:last_day_of_week, Calendar.day_of_week()}]
  | [day: Calendar.day(), op: op(), day_of_week: Calendar.day_of_week()]
@type op() :: :ge | :le
@type output() :: %{
  optional(:zones) => %{required(Calendar.time_zone()) => [zone_state()]},
  optional(:rules) => %{required(TimeZoneInfo.rule_name()) => [rule()]},
  optional(:links) => %{required(Calendar.time_zone()) => Calendar.time_zone()}
}

The parsed data.

@type 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
]
@type time() :: {Calendar.hour(), Calendar.minute(), Calendar.second()}
@type zone_state() :: [
  utc_offset: Calendar.utc_offset(),
  rules: String.t() | integer() | nil,
  format: TimeZoneInfo.Transformer.Abbr.format(),
  until: until(),
  time_standard: TimeZoneInfo.time_standard()
]

Functions

@spec 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.

@spec 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.