automatic-timezoned 1.0.75

Automatically update system timezone based on location
automatic-timezoned-1.0.75 is not a library.

Automatic Timezone Daemon Build Status dependency status

A Linux daemon to automatically update the system timezone based on location.

How It Works

  1. The list of timezones and their location is loaded from the file
  2. The current location is retrieved from GeoClue
  3. The distance between the current location and each timezone is calculated with the Haversine formula
  4. The shortest distance determines the current timezone set via systemd-timedated
  5. Then, the daemon waits for the location updated signal from GeoClue, and repeats from step 2 when it happens

Note: The timezone choice may not be accurate if a reference city in a neighboring timezone is closer than any one in the actual timezone.


Please see the examples/ directory for sample configurations.


$ automatic-timezoned --help
Automatically update system timezone based on location

Usage: automatic-timezoned [OPTIONS]

  -z, --zoneinfo-path <ZONEINFO_PATH>  Path to zoneinfo tab file [env: AUTOTZD_ZONEINFO_FILE=] [default: /usr/share/zoneinfo/]
  -l, --log-level <LOG_LEVEL>          Log level filter. See <> for syntax [env: AUTOTZD_LOG_LEVEL=] [default: info]
  -h, --help                           Print help
  -V, --version                        Print version


Packaging status



cargo build --release


cargo test


This service depends on the tzdata package which allows to update the Time Zone Database independently and does not depend on a third-party service to calculate distances, here are some alternatives which have made different trade-offs for performance and accuracy:


GNU General Public License v3.0