How To Configure Timezone on SLES Linux

Posted by Planet Malaysia on May 9, 2008

advertisement

The following tutorial will guide you How to configure TIMEZONE on SLES Linux.

Basically you can configure Linux timezone using two methods which is using command or YaST.

Note: use timezone “GMT+0“  for an example below.

For YaST timezone setup, it’s pretty simple. Login to terminal and type:

#YasT Setup

yast timezone

Select Global, select GMT+0
Hardware clock Set To: Localtime
Click Accept.

For command line setup, you’re require to know these 2 files /etc/localtime and /etc/sysconfig/clock.

#Backup existing file

mv /etc/localtime /etc/localtime.old

cp /etc/sysconfig/clock /etc/sysconfig/clock.old

#Edit configuration files

ln -s /usr/share/zoneinfo/GMT+0 /etc/localtimevi /etc/sysconfig/clock

TIMEZONE=GMT+0

HWCLOCK="--localtime"

Bear in mind, you can have different timezone setup for individual or global user by using user profile in your system. For an example,

#Edit configuration file

vi /etc/profile or ~username/.bash_profile
export TZ=/usr/share/zoneinfo/Asia/Kuala_Lumpur

Export “TZ” will overwrite /etc/sysconfig/clock or /etc/localtime setup. Mean that I can use Kuala Lumpur as my separate time zone for particular user in the same system eventhrough my primary timezone setup is GMT+0.

NTP setup
#Edit NTP configuration file

vi /etc/ntp.confserver 0.europe.pool.ntp.org

server 1.europe.pool.ntp.org
server 2.europe.pool.ntp.org
server 3.europe.pool.ntp.org
server your.ntp.server

#Restart NTP Server

rcxntpd xntpd restart

Hardware Clock

#showing hardware clock

hwclock --show

#set the system time from the hardware clock

hwclock --hctosys

#set the hardware clock from the system time

hwclock --systohc

Done!

Possibly Related Posts:


Comments

Leave a Reply




Planet Malaysia

  • Follow us on Twitter


  • web www.planetmy.com