# `Zoneinfo`
[🔗](https://github.com/smartrent/zoneinfo/blob/v0.1.8/lib/zoneinfo.ex#L1)

Elixir time zone support for your OS-supplied time zone database

Tell Elixir to use this as the default time zone database by running:

```elixir
Calendar.put_time_zone_database(Zoneinfo.TimeZoneDatabase)
```

Time zone data is loaded from the path returned by `tzpath/0`. The default
is to use `/usr/share/zoneinfo`, but that may be changed by setting the
`$TZDIR` environment or adding the following to your project's `config.exs`:

```elixir
config :zoneinfo, tzpath: "/custom/location"
```

Call `time_zones/0` to get the list of supported time zones.

# `get_metadata`

```elixir
@spec get_metadata(String.t()) :: {:ok, Zoneinfo.Meta.t()} | {:error, atom()}
```

Return Zoneinfo metadata on a time zone

The returned metadata is limited to what's available in the source TZif data
file for the time zone. It's mostly useful for verifying that time zone
information is available for dates used in your application. Note that proper
time zone calculations depend on many things and it's possible that they'll
work outside of the returned ranged. However, it's also possible that a time
zone database was built and then a law changed which invalidates a record.

# `time_zones`

```elixir
@spec time_zones() :: [String.t()]
```

Return all known time zones

This function scans the path returned by `tzpath/0` for all time zones and
performs a basic check on each file. It may not be fast. It will not return
the aliases that zoneinfo uses for backwards compatibility even though they
may still work.

# `tzpath`

```elixir
@spec tzpath() :: binary()
```

Return the path to the time zone files

# `valid_time_zone?`

```elixir
@spec valid_time_zone?(String.t()) :: boolean()
```

Return whether a time zone is valid

---

*Consult [api-reference.md](api-reference.md) for complete listing*
