# zones
[](https://hex.pm/packages/zones)
[](https://hexdocs.pm/zones/)
Prebuilt time zone data for the [`tzif`](https://hexdocs.pm/tzif) package.
Current tzdata version: **2026a**.
## When to use
Generally you should prefer loading time zone information provided by your
operating system by using `tzif` directly. In some cases this may not be
preferrable:
- if your operating system is not being updated,
- if your operating system's time zone information lags behind in updates, or
- if you just otherwise want to control which specific version you are using.
In these situations you may opt to download time zone data
[from IANA](https://www.iana.org/time-zones), process it with `zic`, and then
load it with `tzif`. Alternatively, you may use this package which has done that
part for you.
The downside of this package is that you have to keep it updated by updating the
dependency, and thus releasing a new version of your app. Take this into account
when making your decision on which method to use for obtaining time zone
information.
## Versioning
This package follows modified semantic versioning:
- The major version is bumped if there are backwards incompatible changes to any
interfaces.
- The minor version is bumped on backwards compatible feature additions and
tzdata version changes. It is of the form _XXYYF_, where _XX_ is the last two
numbers of the tzdata year, _YY_ is a running count, corresponding to the
character of the tzdata version — i.e. `a=1`, `b=2`, and so on — and _F_ is
increased if there are any feature additions that do not change the tzdata
version.
- The patch version is reserved for any backwards compatible bug fixes that do
not change interfaces and do not introduce new features.
Thus you can always see the tzdata version that the package contains from the
first four numbers of the minor version.
## Usage
```sh
gleam add zones@1
```
```gleam
import zones
import tzif/tzcalendar
import tzif/database
pub fn main() -> Nil {
let now = timestamp.system_time()
// Load all timezones
let tzdb = zones.database()
case tzcalendar.to_time_and_zone(now, "Europe/Helsinki", db) {
Ok(time_and_zone) -> // See tzif documentation on further usage
...
}
// Alternatively, construct your own database from only the zones you want
let tzdb = database.new()
|> database.add_tzfile("Europe/Helsinki", zones.europe__helsinki)
|> database.add_tzfile("Indian/Reunion", zones.indian__reunion)
}
```