OpenVZ Forum


Home » General » Support » Clock in container is always 2 hours ahead
Clock in container is always 2 hours ahead [message #46742] Thu, 07 June 2012 18:19 Go to previous message
Ikke is currently offline  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?
 
Read Message
Read Message
Previous Topic: CPUUNITS / CPULIMIT
Next Topic: ploop yum update problem
Goto Forum:
  


Current Time: Sun Sep 01 18:55:19 GMT 2024

Total time taken to generate the page: 0.05776 seconds