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?
-
10I think the options you rejected in your question are the only two options you have. Pick one. – Sam Estep Jul 04 '15 at 15:41
-
7If you don't trust the local data and you don't want to get to external data, how would you logically *expect* to get the right time? – Jon Skeet Jul 04 '15 at 15:46
-
@JonSkeet Thanks, that's a good way to sum it up. – Sam Estep Jul 04 '15 at 15:47
-
1Is there a hardware system clock, That i can access, like CMOS? – Ankush Tyagi Jul 04 '15 at 16:06
-
I think you should address your efforts trying to prevent people to "hack around" with time.... – Luigi Cortese Jul 04 '15 at 16:11
-
1Dear Downvoters, Why the down-votes? This is a legitimate question. And it turns out there are indeed solutions such as special hardware devices. Please leave a constructive criticism along with your vote. – Basil Bourque Feb 14 '16 at 23:33
-
See Answers on this duplicate Quetion, [How can I ensure in Java that the current local time is correct?](http://stackoverflow.com/q/32194245/642706) – Basil Bourque Feb 14 '16 at 23:46
1 Answers
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 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.

- 303,325
- 100
- 852
- 1,154
-
I think the sundial method is flawed if there is a lot of cloud cover or the sun decides to explode suddenly. – Abishek Stephen Sep 28 '21 at 08:23