My server clock is running slow for some reason. I need to put a timestamp on my dat开发者_如何学编程abase transactions and need a reliable time source. Is there an api to the world time zone site or something similar?
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.
精彩评论