6

My default location is GMT+1. I would like Ubuntu to automatically change my default timezone based on the timezone of my connected internet connection.

Example:

When I am in Portugal, and connected to an internet connection, I want Ubuntu to change my timezone setting from GMT+1 to GMT+0.

Moreover, I ensured that the following settings are set but they do not make my timezone change:

enter image description here

enter image description here

1

3 Answers 3

5

There is a script in GitHub to detect and update the current time zone, using geolocation from your IP address: https://github.com/cdown/tzupdate

Once python and python-pip are installed, the script can be installed as:

pip install -U tzupdate

And run as

sudo ~/.local/bin/tzupdate

This command could be somehow automatically run on startup.

1
  • Note that /etc/rc.local won't work for running the script automatically, since at that stage the newtork may not yet be available. Apr 14, 2016 at 17:58
4

For Ubuntu 18.04 make sure Settings -> Privacy -> Location Services is set to "On."

Solution provide by glortho Auto Timezone doesn't update

It automatically works right away.

0

For Ubuntu 20.04 you can run the command as current logged-in user ( running as root doesn't change your current user timezone setting )

gsettings set org.gnome.system.location enabled true
gsettings set org.gnome.desktop.datetime automatic-timezone true

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .