Getting time from public time server using TimeTCPClient
NTP is a different protocol than the time protocol. NTP servers only talk over port UDP/123. Time servers use TCP/37 (which TimeTCPClient appears to implement correctly).
If you want to get a remote time, use an appropriate server (ntp.xs4all.nl
appears to be listening on the time port).
.Net API to get exact time for Internet Time Server
There's a third party library that should bail you out. See the NtpClient class
For other alternatives, see the similar thread here
Java: Get current Date and Time from Server not System clock
You could have a look at the Java NTP Client demo available at
http://www.docjar.com/html/api/examples/ntp/NTPClient.java.html
and some example code that utilizes this client
http://www.docjar.com/html/api/examples/ntp/TimeClient.java.html
It's about 170 lines of well documented java code.
How can I query online time servers to get the accurate time
You should not do this from your application code. As you are pointing out there are "some time servers that are used by Windows to auto-update time over internet." So, use an appropriate client program/service to set your server's time on a regular bases. This way your server's clock will always be accurate to the microsecond level. Attempting to query a time-server on a per request bases (as your description suggests) is foolish and causes a great deal of unnecessary overhead.
Related Topics
Java: Check the Date Format of Current String Is According to Required Format or Not
Overload with Different Return Type in Java
How to Use Jaroutputstream to Create a Jar File
Natural Sort Order String Comparison in Java - Is One Built In
Eclipse: How to Build an Executable Jar with External Jar
What Are Runtime.Getruntime().Totalmemory() and Freememory()
When Is the @JSONproperty Property Used and What Is It Used For
Why Is It Not Possible to Extend Annotations in Java
How to Compare Two Dates Without the Time Portion
By Default, Jsf Generates Unusable Ids, Which Are Incompatible with the CSS Part of Web Standards
Java Unsupported Major Minor Version 52.0
What HTML Parsing Libraries Do You Recommend in Java
Embedding Java Applet into .HTML File
Loading Images from Jars for Swing HTML
How Does Auto Boxing/Unboxing Work in Java