服务器上的当前时间与实际时间相差 7 分钟
Current time on server is 7 minutes different than actual time
有人知道这是怎么发生的吗?我的服务器比 google 的实时时间慢 7 分钟(与用户 devices/phones 上显示的实时时间相匹配)。
我在 digital ocean.
上使用 Ubuntu 服务器
当前时间设备每google(和手机):
服务器上的当前时间根据ruby
(在irc中):
Time.zone.now
=> Fri, 27 Jul 2018 09:19:12 CDT -05:00
服务器上的当前时间根据shell
(在irc中):
`date`
=> "Fri Jul 27 14:19:17 UTC 2018\n"
服务器上的当前时间每shell(直接):
$ date
Fri Jul 27 14:19:28 UTC 2018
我怎么休息七分钟?我使用此服务器 运行 已有 4 年多了。我认为这是最近发生的,它导致服务器和终端设备之间的同步出现问题。
编辑:@ 9:39AM CDT 每 Google:
我刚知道 timedatectl
。看来我的服务器时间没有同步:
$ timedatectl
Local time: Fri 2018-07-27 14:32:30 UTC
Universal time: Fri 2018-07-27 14:32:30 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
编辑:@ 9:47AM CDT 每 Google:
我刚刚安装了 NTP
:
$ sudo apt-get update
$ sudo apt-get install ntp
timedatectl
仍然显示 7 分钟关闭,但显示 NTP 同步:是:
$ timedatectl
Local time: Fri 2018-07-27 14:39:38 UTC
Universal time: Fri 2018-07-27 14:39:38 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
编辑:@ 9:50AM CDT 每 Google:
timedatectl
现在显示正确,但又说 NTP 同步:否 :
$ timedatectl
Local time: Fri 2018-07-27 14:50:12 UTC
Universal time: Fri 2018-07-27 14:50:12 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
有人知道这是怎么发生的吗?我的服务器比 google 的实时时间慢 7 分钟(与用户 devices/phones 上显示的实时时间相匹配)。
我在 digital ocean.
上使用 Ubuntu 服务器当前时间设备每google(和手机):
服务器上的当前时间根据
ruby
(在irc中):Time.zone.now => Fri, 27 Jul 2018 09:19:12 CDT -05:00
服务器上的当前时间根据
shell
(在irc中):`date` => "Fri Jul 27 14:19:17 UTC 2018\n"
服务器上的当前时间每shell(直接):
$ date Fri Jul 27 14:19:28 UTC 2018
我怎么休息七分钟?我使用此服务器 运行 已有 4 年多了。我认为这是最近发生的,它导致服务器和终端设备之间的同步出现问题。
编辑:@ 9:39AM CDT 每 Google:
我刚知道 timedatectl
。看来我的服务器时间没有同步:
$ timedatectl
Local time: Fri 2018-07-27 14:32:30 UTC
Universal time: Fri 2018-07-27 14:32:30 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
编辑:@ 9:47AM CDT 每 Google:
我刚刚安装了 NTP
:
$ sudo apt-get update
$ sudo apt-get install ntp
timedatectl
仍然显示 7 分钟关闭,但显示 NTP 同步:是:
$ timedatectl
Local time: Fri 2018-07-27 14:39:38 UTC
Universal time: Fri 2018-07-27 14:39:38 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
编辑:@ 9:50AM CDT 每 Google:
timedatectl
现在显示正确,但又说 NTP 同步:否 :
$ timedatectl
Local time: Fri 2018-07-27 14:50:12 UTC
Universal time: Fri 2018-07-27 14:50:12 UTC
Timezone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a