openvz newbie: howto set timezone = host?

m.ardito

Famous Member
Feb 17, 2010
1,473
18
103
Torino, Italy
hi,

i have a openvz hardy vm, where i get

# date
Mon Mar 26 08:35:33 UTC 2012


while on its pve host

Code:
# date
Mon Mar 26 10:35:31 CEST 2012

i found many web docs, including openvz (http://wiki.openvz.org/Timezone) wiki which state that /etc/localtime is a symlink to a /usr/share/usr/share/zoneinfo file, but both on pve host and on hardy vm i see no links:

openvz vm:

Code:
~# ls -la /etc/localtime
-rw-r--r-- 1 root root 118 Jan  9  2010 /etc/localtime

pve host:

Code:
~# ls -lA /etc/localtime
-rw-r--r-- 1 root root 2652 Jan 20  2011 /etc/localtime

the only "localtime" link i see on openvz and pve host is

Code:
~# ls -la /usr/share/zoneinfo/localtime
lrwxrwxrwx 1 root root 14 Jan 17  2011 /usr/share/zoneinfo/localtime -> /etc/localtime

??? i do not understand
both on the above wiki and in this doc http://www.cyberciti.biz/faq/howto-linux-unix-change-setup-timezone-tz-variable/

i see something different <<
Generic procedure to change timezone
Change directory to /etc
# cd /etc

Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtime
>>

what should i do? should i delete /etc/localtime anyway and create a link to ?

also tried to UTC=no (was yes) in /etc/default/scS, as is on pve host

can some gentle fellow explain me ? :-D

Thanks all

Marco
 
i have to reply myself:

i found i had to use

Code:
dpkg-reconfigure tzdata

on openvz vm, and everything's fine.... selecting Europe/Rome i now have CEST time displayed...

i have still no /etc/localtime as symlink, is a regular file now...

solved, but still don't understand...

Marco
 
  • Like
Reactions: brewerexpert