I am vistababa!

How to Change the Timezone in Linux?

leave a comment »

Most modern Linux distributions have user-friendly programs to set the timezone, often accessible through the program menus or right-clicking the clock in a desktop environment such as KDE or GNOME. Failing that it’s possible to manually change the system timezone in Linux in a few short steps.

1. Logged in as root. Check which timezone your machine is currently using by executing `date`:

Mon 17 Jan 2005 12:15:08 PM PST

PST in this case is the current timezone.

2. Change to the directory /usr/share/zoneinfo. Here you will find a list of time zone regions. Choose the most appropriate region. For example if you live in Canada or the US this directory is the “America” directory.

3. If you wish, backup the previous timezone configuration by renaming it:

# mv /etc/localtime /etc/localtime.old

4. Create a symbolic link to the appropriate timezone from /etc/localtime. Example:

# ln -sf /usr/share/zoneinfo/Asia/Tehran /etc/localtime

5. Set the TIMEZONE, HWCLOCK entries in the file /etc/sysconfig/clock file to the appropriate values:

TIMEZONE="Asia/Tehran"
HWCLOCK="--localtime"

6. Set the hardware clock:

# hwclock --localtime

Reference: How to Change the Timezone in Linux

Advertisement

Written by Vistababa

July 19, 2010 at 2:36 pm

Posted in Uncategorized

Tagged with , ,

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 )

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

Follow

Get every new post delivered to your Inbox.