gpt4 book ai didi

datetime - Ubuntu shell 脚本 : Get and echo time from ntp server without synchronization

转载 作者:行者123 更新时间:2023-12-04 18:30:27 25 4
gpt4 key购买 nike

有没有办法在不更新我的机器的情况下使用 pool.ntp.org 中的 shell 脚本来获得时间?

ntpdate pool.ntp.org 只是更新我的机器。

先感谢您

最佳答案

取决于您坚持使用 ntp 服务器的强度。有的还支持daytime协议(protocol),可以在13端口查询

nc time.nist.gov 13

但是如果你不介意使用 http://www.timeapi.org/那么使用 curl 就很简单了。例如,要获取当前的 UTC 时间,您将使用
curl http://www.timeapi.org/utc/now

有关更多示例和功能,请查看上面的链接。

关于datetime - Ubuntu shell 脚本 : Get and echo time from ntp server without synchronization,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29794923/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com