$ sntp -c 192.168.0.10
sntp 4.2.8p12@1.3728-o (1)
Can't open KOD db file /var/lib/sntp/kod for writing: Permission denied
2025-02-28 16:31:12.839708 (-0800) +0.0 +/- 0.014694 192.168.0.10 s1 no-leap
我就真的一直很困惑,为啥我的日期时间时区都是对的,给我的结果的时区显示的是-0800 呢?
看了下文档:
The default is to write the estimated correct local date and time (i.e. not UTC) to the standard output in a format like: '1996-10-15 20:17:25.123 (+0800) +4.567 +/- 0.089 [host] IP sN' where the '(+0800)' means that to get to UTC from the reported local time one must add 8 hours and 0 minutes,
彳亍。
+8000 是说你看到的时间再加上 8 个小时是 UTC (实际上是 UTC-8 的西八区)
东八区当然显示-0800 了
做个实验,带上其他 TZ 执行 sntp:
$ TZ=UTC sntp -c 192.168.0.10
sntp 4.2.8p12@1.3728-o (1)
Can't open KOD db file /var/lib/sntp/kod for writing: Permission denied
2025-02-28 08:33:22.297831 (+0000) +0.0 +/- 0.011989 192.168.0.10 s1 no-leap
这就对了嘛
![]() |
1
Belmode 30 天前
你认真的吗
|