configuring the timezone in your dedicated server

From WebHostingNeeds.com
Jump to: navigation, search

To set time to UTC/GMT

vi /etc/sysconfig/clock

Replace with

FOR GMT

ZONE="UTC"

For IST

ZONE="Asia/Kolkata"


Delete localtime file

rm -f /etc/localtime

Create symlink to proper zone file

For GMT

ln -s /usr/share/zoneinfo/UTC /etc/localtime

For IST

ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime


If you need it set to America/New_York time, use following command

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


Update time from ntp server

yum install rdate
/usr/bin/rdate -s time-a.nist.gov


AUTO UPDATE TIME

List of time servers available at

http://tf.nist.gov/tf-cgi/servers.cgi

Set Cronjob to update time daily

/usr/bin/rdate -s time-a.nist.gov 
crontab -e


Add

0 0 * * * /usr/bin/rdate -s time-a.nist.gov 


This will update server time everyday at 0 hours.

Set Time From Command line

To set date from command line

date -s "13 FEB 2010 12:54:00"




set time zone for a user in linux server

server setup

date

time