Created
March 1, 2020 10:05
-
-
Save hajowieland/33fa0a77ee940b04b6e570d26b6cf9d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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