I want to get current time in Java but without the Internet and without the system time

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.

photo of a couple of radio clock via USB 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 or similar systems.

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.

photo of a sundial on a pedestal in a garden

Leave a Comment