How To Change Time Zone In Linux

Today I will be showing you how to quickly and easily change your time zone on a Linux system. To do this we will be searching for the closest time zone file New York for example, and then copying it over /etc/localtime. This file is what your system uses to get the local time, you should not try to edit this file manually. So lets get started!

List Available Time Zones In Linux

You can list all of the available time zones by listing the contents of the /usr/share/zoneinfo/America/ directory. To do this simply run the following command.

ls /usr/share/zoneinfo/America/

If you want to do a simple search you can use grep as-well. Here is an example of how to find the name of the New York time zone.

ls -l /usr/share/zoneinfo/America/ | grep -i "york"

Change Time Zone In Linux

To change your current time zone in Linux all you need to do is run the following command and replace “New_York” with whatever time zone you wish to use. This should also set your date and clock for you automatically however if for some reason it doesn’t, you can use this guide to set your date and time in Linux.

cp /usr/share/zoneinfo/America/New_York /etc/localtime

If you don’t want to copy the file then you can also create a symbolic link using the following command instead.

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

Verify Time Zone Change

You can verify that your time zone as-well as date and time have been updated by running the date command.

date

I hope this guide has helped you change time zone in Linux, please don’t forget to like, comment, or share using the social media buttons below. Thank you!

Leave a Reply

Protected with IP Blacklist CloudIP Blacklist Cloud