我希望在Java中获得当前时间,但没有Internet,也没有系统时间

时间:2015-07-04 15:39:50

标签: java time core

我想获得准确的当前时间。我不想要系统时间,因为任何人都可以改变它,我想在不访问互联网的情况下这样做,有办法吗?

1 个答案:

答案 0 :(得分:6)

时间服务器

在本地网络上设置time server。让您的应用程序联系本地时间服务器以查询当前时间。

考虑将该时间服务器计算机放在network’s DMZ中,以便更新来自互联网上的时间服务器,例如pool.ntp.org projectthose provided by the United States federal government (NIST)

无线电时钟

获得具有radio clock连接的USB,用于通过连接到诸如原子钟的时间标准的无线电发射器发送的时间码同步的当前时间的输出。发射机正在世界各地的许多国家广播。

Meinberg Global公司至少提供several such devices

photo of a couple of radio clock via USB devices

GPS

与上述无线电时钟类似,GPS(Global Positioning System)信号的接收器也可能捕获并转发time signal。或者GALILEOGLONASSsimilar systems

日晷

在窗口外放置sundial。将webcam附加到相关计算机上。将网络摄像头放在窗口中。编写一个应用程序来解释日历当前图像的时间。

photo of a sundial on a pedestal in a garden