Friday 5 July 2013

Change timezone in Openvz VPS



The file /etc/localtime is the one which holds information of server’s timezone.

For changing the timezone you should point it to the correct zone file by creating a soft link.

From following commands below we are changing the current timezone to IST:

Firstly move the current localtime file as backup.

#mv /etc/localtime /etc/localtime.bak
Now from /usr/share/zoneinfo/ you can find the preferred timezone. Once you found the timezone file, crate a soft link   to  /etc/localtime. Eg: For IST

#ln -sf /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
Once the link is created, reboot the vps. 

#reboot

You are done!! Now you can find your timezone.



No comments:

Post a Comment