Time drift

The Network Time Protocol, or NTP, can be used to synchronize the time on a server with an authoritative source. Windows Servers, for example, will use one of the network domain controllers (the DC which holds the PDC emulator FSMO role for the domain [thanks Graeme]) to get time information. You can configure the domain … Read more

How to Query an NTP Server using C#?

Since the old accepted answer got deleted (It was a link to a Google code search results that no longer exist), I figured I could answer this question for future reference : public static DateTime GetNetworkTime() { //default Windows time server const string ntpServer = “time.windows.com”; // NTP message size – 16 bytes of the … Read more

Will a docker container auto sync time with its host machine?

If you are on OSX running boot2docker, see this issue: https://github.com/boot2docker/boot2docker/issues/290 Time synch becomes an issue because the boot2docker host has its time drift while your OS is asleep. Time synch with your docker container cannot be resolved by running your container with -v /etc/localtime:/etc/localtime:ro Instead, for now, you have to periodically run this on … Read more

Synchronize clock with NTP while online, and with RTC while offline?

Your situation is unusual, and I’d be surprised if anyone comes up with a standard ntpd-based configuration to do what you want. That said, I like being surprised, and it happens quite often around these parts. But until someone comes up with a better idea, have you considered a crontab entry like this? */5 * … Read more