2012-07-19 15:20:12 +0000 2012-07-19 15:20:12 +0000
58
58

如何在Windows下查询NTP服务器?

我对本地时钟与远程服务器同步不感兴趣。我只想查询它并打印出结果。

我本来以为Windows下有一个ntpq的端口,但却找不到。

我能找到的所有其他NTP客户端,他们总是想把自己安装成服务,或者说他们想同步我的本地时间。

答案 (3)

82
82
82
2012-07-19 16:46:51 +0000
C:\> w32tm /stripchart /computer:foo
Tracking foo [1.2.3.4].
The current time is 19/07/2012 17:39:48 (local time).
17:39:48 d:-00.0000840s o:-25.3004160s [@ |]
17:39:50 d:-00.0000680s o:-25.3070080s [@ |]
17:39:52 d:-00.0000690s o:-25.2987405s [@ |]
17:39:54 d:-00.0000680s o:-25.3071530s [@ |]
17:39:56 d:-00.0000690s o:-25.2993985s [@ |]
17:39:58 d:-00.0000680s o:-25.3070270s [@ |]

Wireshark显示NTP数据包由此生成。~~有些版本的w32tm有一个/query选项~

C:\>w32tm /stripchart /computer:us.pool.ntp.org /dataonly /samples:5
Tracking us.pool.ntp.org [208.87.221.228:123].
Collecting 5 samples.
The current time is 19/07/2012 18:36:32.
18:36:32, +03.3575094s
18:36:34, +03.3573679s
18:36:37, +03.3572986s
18:36:39, +03.3570290s
18:36:41, +03.3565357s
9
9
9
2012-07-19 15:24:43 +0000

Bytefusion的ntpquery看起来非常老旧,但还是能用。可悲的是,它需要初始化安装,但复制到另一个系统时,应用程序文件可以正常工作。

1
1
1
2018-12-03 17:45:23 +0000