I need to get the current datetime from a reliable source, because its likely that the local system time could be changed.

Is it possible to get this from an internet time server, one that has close to 100% uptime, preferably via a webservice method, something that is free, and I have to stress absolutely reliable?

I would hope an offering from Microsoft, or the organisation responsible for keeping global time.

link|improve this question

78% accept rate
you were hoping for a service that would provide Microsoft Time? – akf Jul 28 '09 at 11:52
yeah, that's something like Moscow time - only global ;) – Stroboskop Jul 28 '09 at 12:05
These are the two defaults that ship with XP Pro: * time.windows.com * time.nist.gov – p858snake Jul 29 '09 at 11:18
feedback

migrated from stackoverflow.com Jul 29 '09 at 0:35

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 14 down vote accepted

Give a try to:

http://www.pool.ntp.org/zone/

It has a pool of NTP servers which provides accurate time data.

NTP is a protocol so you can write easily a client to query the time.

link|improve this answer
Thanks, but I will use this as a last resort, what I am really interested in is an exposed webservice. – JL Jul 28 '09 at 11:51
5  
Synching time over a webservice seems like a tremendously bad idea. NTP is a well established protocol that was specifically developed to deliver accurate results. – innaM Jul 28 '09 at 12:07
1  
This is exactly what NTP is for. You send it a request via UDP and receive a response with time information. It's an old, reliable and robust protocol and most NTP servers have very high availability. In addition to that, you can query multiple NTP servers in case 1 is down. – Tommy Carlier Jul 28 '09 at 12:08
1  
Moreover, if NTP could suffer about network latency, imagine a webservice request with all that SOAP glory – HyLian Jul 28 '09 at 12:25
So... this exact Pool.ntp.org/zone - this is the right server to use? – JL Jul 28 '09 at 12:56
show 1 more comment
feedback

http://www.pool.ntp.org/ is a web page that guides you through which pool of servers you should use (which is closer to you), pool contains large amount of servers so its very less likely that you'll stumble upon on a non-working server, very recommended. http will never deliver same precise time as ntp

link|improve this answer
feedback

Pretty much every web server will tell you the time.

$ telnet www.google.com 80
Trying 74.125.224.52...
Connected to www.google.com.
Escape character is '^]'.
GET /moose HTTP/1.0
Host: www.google.com

HTTP/1.0 404 Not Found
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Date: Fri, 26 Aug 2011 08:58:28 GMT
Server: sffe
Content-Length: 11793
X-XSS-Protection: 1; mode=block
...

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.