Reputation: 4807
My server clock is running slow for some reason. I need to put a timestamp on my database transactions and need a reliable time source. Is there an api to the world time zone site or something similar?
Upvotes: 0
Views: 356
Reputation: 164301
You know you can get the server to automatically synchronize with a known time server, right ? Might be easier than coding something custom.
If you want to implement it yourself, you will need to implement a client of the Simple Network Time Protocol (or find an open source one). There are plenty of SNTP servers available, and the SNTP should be relatively easy to implement. Here is the RFC.
Upvotes: 1