View Source TimeZoneInfo.IanaParser (TimeZoneInfo v0.6.1)
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
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
Specs
data() :: binary()
The raw IANA data.
Specs
day() :: non_neg_integer() | [{:last_day_of_week, Calendar.day_of_week()}] | [day: Calendar.day(), op: op(), day_of_week: Calendar.day_of_week()]
Specs
op() :: :ge | :le
Specs
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.
Specs
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 ]
Specs
time() :: {Calendar.hour(), Calendar.minute(), Calendar.second()}
Specs
until() :: {Calendar.year()} | {Calendar.year(), Calendar.month()} | {Calendar.year(), Calendar.month(), day()} | {Calendar.year(), Calendar.month(), day(), Calendar.hour()} | {Calendar.year(), Calendar.month(), day(), Calendar.hour(), Calendar.minute()} | {Calendar.year(), Calendar.month(), day(), Calendar.hour(), Calendar.minute(), Calendar.second()}
Specs
zone_state() :: [ utc_offset: Calendar.utc_offset(), rules: String.t() | integer() | nil, format: TimeZoneInfo.Transformer.Abbr.format(), until: until(), time_standard: TimeZoneInfo.time_standard() ]
Link to this section Functions
Specs
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
.
Specs
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
.