[dba-Tech] worldtime.io and the other ways to programmatically get the current UTC time

Gustav Brock gustav at cactus.dk
Mon Nov 30 04:43:53 CST 2015


Hi Shamil

Here, worldtime.io seems to be one second off.

For the last many years I've used pool.ntp.org - or rather the sub host as listed here:

    http://support.ntp.org/bin/view/Servers/NTPPoolServers

If you on this page click europe.pool.nt.org

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

you'll see dk.pool.ntp.org as well as ru.pool.ntp.org. These servers are probably those nearest to you.
Other sources exist like Physikalisch-Technische Bundesanstalt (ptb) in Braunschweig:

https://www.ptb.de/cms/ptb/fachabteilungen/abtq/fb-q4/ag-q42/zeitsynchronisation-von-rechnern-mit-hilfe-des-network-time-protocol-ntp.html

My primary domain server adjust to the external ntp pool, and all other machines sync to these servers, not time.microsoft.com.

Calling an NTP source is the closest you can get "easy" accurate time. The more precise alternative is a hardware clock that via longwave radio syncs to the European authorative time source in Frankfurt, but these are quite expensive.

Which code from SO do you use? Several suggestions are listed.

/gustav


-----Oprindelig meddelelse-----
Fra: dba-Tech [mailto:dba-tech-bounces at databaseadvisors.com] På vegne af Salakhetdinov Shamil
Sendt: 29. november 2015 23:08
Til: Discussion of Hardware and Software issues <dba-tech at databaseadvisors.com>
Emne: [dba-Tech] worldtime.io and the other ways to programmatically get the current UTC time

 Hi All --

The subject web site worldtime.io seems to be providing incorrect current time - compare with  http://www.timeanddate.com/worldclock/  (middle page).

I have to find a way to get correct current time independent from my MS Windows system - I'm using the code from checked answer from the following topic 

http://stackoverflow.com/questions/1193955/how-to-query-an-ntp-server-using-c

and the time value it returns seems to be in sync with my system time.

Do you now any other way to get the current UTC time preferably using a free  (RESTFul) webservice?

Thank you.

-- 
Салахетдинов Шамиль 



More information about the dba-Tech mailing list