服务器显示错误的 UTC 时间

dav*_*vid 4 linux centos timezone utc

我正在运行 CentOS 服务器,但似乎无法正确设置时间。我的问题是我已将时区设置为 UTC,服务器似乎承认这一点,但它仍然指出错误的时间!

真正的 UTC 时间 = 16:56(我当地的时区是 GMT)

# hwclock –show
wed 09 Mar 10:56:48 AM UTC -0.502715 seconds

# date
Wed Mar 9 10:56:51 UTC 2011
Run Code Online (Sandbox Code Playgroud)

即服务器似乎在说它是在 UTC 时间......但 6 小时后!

我已经采取了几个步骤来尝试纠正这个问题,包括:

1. Use setup to manually pick the timezone
# system-config-date (Set to Etc/UTC)

2. Set the timezone in the localtime file
# ln -sf /usr/share/zoneinfo/UTC /etc/localtime

3. Change the UTC value in the /etc/sysconfig/clock file
I have tried both UTC=true and UTC=false
Run Code Online (Sandbox Code Playgroud)

这些解决方案都没有奏效

请帮忙,

大卫

dan*_*man 6

大卫,

您已经设置了时区,现在您只需设置时间。有很多方法可以做到这一点。我通常这样做:

ntpdate ntp.uiuc.edu
Run Code Online (Sandbox Code Playgroud)

或者在快速谷歌搜索中使用任何其他方法来设置 CentOS 上的时间。

干杯,-丹尼