Changing timezone in Linux terminal

Depending on what distro of linux you’re using you might not be offered to choose a timezone on install, potentially leaving you with an incorrect system time. This short tutorial will detail how to set your system time through bash.

First delete your localtime file, which stores your current timezone information.

rm /etc/localtime

Now find your timezone in the following directory

/usr/share/zoneinfo/

Create a symbolic link from your timezone to /etc/localtime

ln -s  /usr/share/zoneinfo/Pacific/Auckland /etc/localtime

Now running

date

Should show the correct time.

Wed Apr 26 08:10:02 NZST 2017

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s