What should you do when dpkg-reconfigure tzdata is not working
How will you change server time?
On Linux Server::
1. Login as a Root.
2. The time zones are located on server in the directory /usr/share/zoneinfo, so change the directory to that one.
[email protected] [~]# cd /usr/share/zoneinfo
3. Copy or move the current local time zone so that you will be able to set the time zone as per requirement.
[email protected] [~]#cp -p /etc/localtime /etc/localtime-back
[email protected] [~]#mv /etc/localtime /etc/localtime-back
4. Now say for example, if you want to set the BST [British Summer Time] time zone for your server then,
you will need to create a symbolic link for the same. The command is as follows.
[email protected] [~]#ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
Verify the changes done by “date” command.Code:
[email protected] [~]#date
Mon Oct 20 04:51:57 BST 2008
If you get the below error while trying to change the time,
you need to allow permission to the VPS to change time in the main node.
# date 031612482009
date: cannot set date: Operation not permitted
To correct this problem, exit from the container (#exit) and issue the following commands.
Login to the main node
# vzctl stop
# vzctl set –save –capability sys_time:on
# vzctl start
Where <veid> is your Virtual Environment ID. Next, log back into your virtual environment
and issue the following commands to set the appropriate time-zone for the Virtual Environment (VE).
# vzctl enter
# mv /etc/localtime /etc/localtime.old
# ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime