I want to get current time in Java but without the

2019-01-08 02:18发布

问题:

I want to get the exact current time. I do not want the system time because that can be changed by any person and i want to do this without accessing the internet, is there a way?

回答1:

Time Server

Set up a time server on your local network. Have your app contact that local time server to query the current time.

Consider placing that time server computer in network’s DMZ so as to updates from time servers on the Internet such as the pool.ntp.org project or those provided by the United States federal government (NIST).

Radio Clock

Obtain a radio clock with a USB connection for output of current time synchronized by a time code transmitted by a radio transmitter connected to a time standard such as an atomic clock. Transmitters are broadcasting in many countries all over the world.

The Meinberg Global company, at least, offers several such devices.

GPS

Similar to the radio clocks above, a receiver of GPS (Global Positioning System) signals might also capture and relay the time signal. Or perhaps GALILEO or GLONASS.

Sundial

Position a sundial outside a window. Attach a webcam to the computer in question. Position the webcam in the window. Write an app to interpret the time of day from current image of the sundial.



标签: java time core