views:

25

answers:

1

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?

+1  A: 

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.

driis
I did not know that I could sync the server time. Thanks for providing both options.
user279521