Set systemd based Linux system timezone in one command

Andy

Administrator
Creative Team
User ID
1
Joined
7 Jan 2019
Messages
1,121
Reaction score
57
Points
48
Most modern distro such as RHEL/CentOS v.7.x+, Fedora Linux, Debian, Ubuntu, Arch Linux and others runs systemd, so you need to use the timedatectl utility. Here's how to easy it is to set the server timezone; we need one command:
Bash:
sudo timedatectl set-timezone 'Pacific/Auckland'

Hint: To see a list of all available time zones, use the command below:
Bash:
$ timedatectl list-timezones
$ timedatectl list-timezones | more
$ timedatectl list-timezones | grep -i Pacific
$ timedatectl list-timezones | grep Pacific/Auckland
 
 Short URL:
Back
Top