how to get real date (not system date) by c# or c++?

前端 未结 5 786
情歌与酒
情歌与酒 2021-01-13 12:49

Is it possible to get real date (not system date) without any connection to internet? I developed my application by C#. DateTime.Now gets system date but I want to know real

5条回答
  •  广开言路
    2021-01-13 13:36

    Even without the internet, there are other "reliable" external time sources. However, the internet is the easiest and a number of time protocols/servers already exist. These are provided as thoughts, and not necessarily as viable solutions.

    1. NIST atomic clock broadcasts (e.g. how those "atomic watches" work). I am not sure of any commodity hardware for a PC to read these signals. Go befriend an electronics engineer.

    2. GPS. There is plenty of different GPS hardware available to connect to a PC (USB dongles, etc). Even, say, an iPhone. (Modern cell phones will get time synchronization from the network, even without GPS support.)

    3. Your very own atomic clock! Drift should be ignorable ;-)

    Happy ... stuff.

提交回复
热议问题