Clock in container is always 2 hours ahead [message #46742] |
Thu, 07 June 2012 18:19 ![Go to next message Go to previous message](/theme/ovz3/images/down.png) |
Ikke
Messages: 1 Registered: June 2012
|
Junior Member |
|
|
I've recently got a VPS with OpenVZ. However, no matter what I do in the container the clock is 2 hours ahead. I simply put my /etc/localtime to point to the local timezone (CEST) but my clock is then 2 hours ahead.
If I type date --utc I also get a value for UTC which is two hours ahead.
Finally I made a a small program:
Quote:
#include <sys/time.h>
#include <stdio.h>
int main(void) {
struct timezone tz;
gettimeofday(NULL, &tz);
printf("%d\n", tz.tz_minuteswest);
return 0;
}
It prints '-120' to indicate that the system clock is 120 minutes ahead of UTC... yet the problem is: it isn't! settimeofday doesn't work in the container. So I'm somewhat stuck.
The question now is, how is this handled in OpenVZ? Does this value come from the HW node? In that case my hoster has its settings wrong (?). Or can you actually set this offset somehow in a container without any time setting capabilities?
|
|
|