Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hajowieland/33fa0a77ee940b04b6e570d26b6cf9d0 to your computer and use it in GitHub Desktop.
Save hajowieland/33fa0a77ee940b04b6e570d26b6cf9d0 to your computer and use it in GitHub Desktop.
# 1. it find your public ip via ifconfig.io
# 2. than use this IP to request your timezone via worldtimeapi.org
# 3. and send it to the command timedatectl set-timezone
# By: https://www.commandlinefu.com/commands/view/24463/programmatic-way-to-find-and-set-your-timezone
sudo timedatectl set-timezone $(curl worldtimeapi.org/api/ip/$(curl ifconfig.io/ip)|cut -d\" -f16
# Without systemd:
echo 'Etc/UTC' | tee /etc/timezone; dpkg-reconfigure --frontend noninteractive tzdata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment