2

I've just tried to set the timezone on my VPS to Europe/London:

ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime

This was fine. However, the time is now wildly out:

$ date
Sat Feb  5 12:33:21 GMT 2011

When it is in fact 22:31.

With it being a VPS, trying to do

$ date -s 22:31

also fails.

Is this something I can fix, or do I need my host to do something?

Thanks.

Dan
  • 21
  • 1
  • 3

3 Answers3

2

if using xen, try

echo 1 > /proc/sys/xen/independent_wallclock

and set date time again

chocripple
  • 2,039
  • 14
  • 9
0

Can you try this from the date man page?

   date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

So, for 22:31, you'd type date 02052231.

or the full string containing century, year and seconds...

date 020522312011.00

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • # date 02052237 date: cannot set date: Operation not permitted. I think it's due to the server being a VPS. – Dan Feb 05 '11 at 22:38
  • Do you have access to an `ntpdate` command? Perhaps `ntpdate time.apple.com` – ewwhite Feb 05 '11 at 22:39
  • No ntpdate, but I suspect the result would be the same as using date. rdate certainly doesn't work (same error as above). – Dan Feb 05 '11 at 22:53
0

Use:

/bin/rm /etc/localtime
/bin/ln -s /usr/share/zoneinfo/Europe/London /etc/localtime

See this for more info. Only works on RH systems I believe.

atx
  • 1,281
  • 1
  • 9
  • 25
  • I did this to set the timezone, and it's done that fine (at least, the time is reported as being GMT) -- but the time itself is wrong. Thanks. – Dan Feb 05 '11 at 22:43
  • Hmmm, how odd. Should change the time in all applications. – atx Feb 05 '11 at 22:48