comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Get time and date from a server using a socket
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Get time and date from a server using a socket [message #65363 is a reply to message #65358] Thu, 26 February 2009 00:21 Go to previous messageGo to previous message
Allan Whiteford is currently offline  Allan Whiteford
Messages: 117
Registered: June 2006
Senior Member
bernat wrote:
> Hello people,
>
> I'm trying to get the time and date from a public server using this
> code:
>
> SOCKET, 1, servername, 13
> date=''
> READF, 1, date
> CLOSE, 1
> PRINT, date
>
> I tried to get the date from all the servers that I found in the
> following link: http://tf.nist.gov/tf-cgi/servers.cgi
>
> The port 13 is the port for the daytime but I tried with 37 and 123
> ports (time and NTP protocol).
> I can't obtain a good result. Does anybody tried that ? Any
> suggestions or comments ?
>
> Thanks in advance,
>
> Bernat
>
>

Bernat,

NTP uses UDP rather than TCP for communication. Socket only does (as far
as I know) TCP communication. I don't think IDL can (easily) do UDP.
Probably spawning an external program is the way to go if you want to
use NTP over UDP. I have no idea about the other protocols.

If it's useful, the unix command "ntpdate -q servername" will attempt to
speak NTP for you and print the time back to the screen.

You should also check that firewalls, either on your local machine or at
your connection to the internet, aren't blocking things. Some large
organisations run their own time servers and block access to external ones.

Stepping back from the problem (and making some assumptions) another
possible solution is probably for you to run time synchronization
software on your local computer so that the time and date are always
correct when just ask IDL for the local system time.

Thanks,

Allan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Fractions in IDL
Next Topic: Get time and date from a server using a socket

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 05:04:33 PDT 2025

Total time taken to generate the page: 1.67839 seconds