If you're like us, you'll want your server's timezone to match your local time to make log management easier. Fortunately, this is easy to do! This guide works perfectly on servers running RHEL derivatives like CentOS or AlmaLinux, and may vary on other Linux distributions.
mv /etc/localtime /etc/localtime.bak
ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
In the above example, we've taken a backup of the /etc/localtime
file, and adjusted the timezone to Europe/London
.
To make this change permanent, you need to edit the file /etc/sysconfig/clock
and add the entry ZONE="Europe/London"
and save the file. This will keep the time zone even after the server reboot.
A list of supported timezones can be found here.