Editing Timezone

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
Time difference between Hardware Node and container.
+
Time difference between Hardware Node and VPS
  
During the distribution (redhat/centos) installer, you choose the timezone for your HN. The container template has its own preconfigured timezone. So, it is very possible for the zones to differ.
+
During the distribution (redhat/centos) installer, you choose the timezone for your HN. The VE template has its own preconfigured timezone. So, its very possible for the zones to differ.
  
To resolve the problem, you should configure your container to have the same timezone as the HN. For example, if EST is your preferred timezone:
+
 
 +
To resolve the problem, You should configure your VE to have the same timezone as the HN. For example, if EST is your preferred timezone:
  
 
<pre>rm -rf /etc/localtime 2>/dev/null; unlink /etc/localtime 2>/dev/null
 
<pre>rm -rf /etc/localtime 2>/dev/null; unlink /etc/localtime 2>/dev/null
Line 18: Line 19:
 
You can find many more exciting timezones with:
 
You can find many more exciting timezones with:
  
find /usr/share/zoneinfo/ | more
+
find /usr/share/zoneinfo/ | more
 +
 
 +
 
  
Or, here is a shell script that will let you change the timezones in ALL of your containers:
+
Or, here is a shell script that will let you change the timezones in ALL of your VPS's:
  
 
<pre>#! /bin/bash
 
<pre>#! /bin/bash
 
for f in `ls /vz/private`
 
for f in `ls /vz/private`
 
do
 
do
vzctl exec $f rm -f /etc/localtime 2>/dev/null
+
vzctl exec $f rm -rf /etc/localtime 2>/dev/null
 +
vzctl exec $f unlink /etc/localtime 2>/dev/null
 
vzctl exec $f ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime
 
vzctl exec $f ln -s /usr/share/zoneinfo/CST6CDT /etc/localtime
 
done</pre>
 
done</pre>
  
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)