How to set Timezone in Linux

Login to the server via SSH.
Change the location to /etc,
# cd /etc
Create a symlink to file localtime, note that here we need to replace ZONEFILE with the required timezone name
# ln -sf /usr/share/zoneinfo/ZONEFILE localtime
In some Linux distributions zonefile path will be /usr/share/zoneinfo/dirname/zonefile. So we need to use the correct folder name in the above command
Finally verify the changes using date command
# date
Sync the hardware timezone with system timezone
# hwclock --systohc
Verify the hardware timezone
# hwclock --show

Leave a Reply

Your email address will not be published. Required fields are marked *