tags:

views:

101

answers:

4

How can I check the actual date and time by using an internet connection? I would like to receive the response from the server as a simple string; I don't want to parse an HTML response.

+4  A: 

You can find a lot of information on getting date and time from a server here.
Listed on that page are several protocols that are designed to requesting and retrieving date and time:

From there, you can easily find some public servers that support one of these protocols. Then it's just a matter of writing some code to access one of these servers in a way that conforms to the protocol spec.

Or you can use some that's already been written and made freely available, for example:

Here (DAYTIME protocol) or Here (NTP protocol)

Donut
Thank you, it is helpfull
John
A: 

You may find Building Links to World Time Server.com helpful. They offer several approaches.

DOK
+1  A: 

Here is a post about getting internet time: C#: Get NIST Internet Time

gcores
Very helpfull, thank you very much
John
A: 

You should probably look at ntp which is a generic standard for syncing date and time. However windows time already uses that in a domain environment and can be configured to sync against public servers.

rerun