服务器显示错误的 UTC 时间

服务器显示错误的 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

也就是说,服务器似乎说它是 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

这些解决方案均无效

请帮忙,

大卫

答案1

大卫,

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

ntpdate ntp.uiuc.edu

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

欢呼,-丹尼

答案2

我不想问,但是……你有没有做过任何事来修正时间本身?似乎时区没问题,但时间不对。

您是否使用命令手动设置时间date或同步到 NTP 服务器?

相关内容