VPSMATE

  • HOME
  • NEWS
  • VPS
  • DEDICATED
  • ARCHIVES
  • GoDaddy
  • SCRIPT
  • TOOLS
    • Traceroute
    • Benchmark
    • Useful Sites
  • Themes
  • GFW
VPSMATE
VPS COUPON & PROMOS | VPS & DEDICATED SERVERS OFFERS | VPS REVIEWS
  1. Main page
  2. Tips
  3. Main content

Change VPS Time Zone

05/01/2014 9032hotness 0likes 0comments

time_zones

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.

Code:

[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.

Code:

[email protected] [~]#cp -p /etc/localtime /etc/localtime-back

Or

[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.

Code:

[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.

Error:-

# date 031612482009

date: cannot set date: Operation not permitted

Fix:-

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

# date

Related

Tag: dpkg-reconfigure tzdata Time Zone
Last updated:05/01/2014

kyaky

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

Comments

Cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.

COPYRIGHT © 2021 vpsmate.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang