use of ntp service
Check out the SNTP client code at: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/net/SntpClient.java
Check out the SNTP client code at: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/net/SntpClient.java
this works in c++ (adapted from c). it will get you UTC time from pool.ntp.br (you MUST use IP). if you manage to work out how to get DAYTIME (daylight savings – horario verao), please advise. i can get it from UFRJ pads servers, but UFRJ is unreliable, what with them being on strike half … Read more
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
The source for this answer is the comment to the answer at: Will docker container auto sync time with the host machine? After looking at the answer, I realized that there is no way a clock drift will occur on the docker container. Docker uses the same clock as the host and the docker cannot … Read more
there is a NTP Java implementation on support.ntp.org
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