Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

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

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

    
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

3 Answers 3

up vote 15 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.

share|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
8  
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

www.pool.ntp.org is a web page that guides you through which pool of servers you should use (which is closer to you). The NTP pool contains large number of servers, so it's very unlikely that you'll stumble upon on a non-working server; very recommended. HTTP will never deliver precise time like NTP.

share|improve this answer

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
...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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