Last active
October 26, 2019 09:54
-
-
Save alphamarket/8eedb131db18b060808a86ce8f5a8115 to your computer and use it in GitHub Desktop.
Change/Restore Linux's System Date & Time
This file contains 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
# disable NTP sync | |
sudo timedatectl set-ntp false | |
# set the date-time | |
sudo timedatectl set-time "2019-10-29 16:20:00" | |
# set the timezone | |
sudo timedatectl set-timezone Europe/London |
This file contains 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
# select & set the timezone | |
sudo timedatectl set-timezone `timedatectl list-timezones | grep <city>` | |
# enable the NTP service to auto-update the datetime | |
sudo timedatectl set-ntp true | |
# If using a service like chrony or ntpd to make changes, | |
# these are not shown by timedatectl until systemd-timesyncd is restarted: | |
sudo systemctl restart systemd-timesyncd | |
# check timesyncd's status | |
sudo systemctl status systemd-timesyncd | |
# check the timedatectl status | |
timedatectl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment